aboutsummaryrefslogtreecommitdiffstats
path: root/clientserver.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-07-29 18:31:10 +0000
committerWayne Davison <wayned@samba.org>2005-07-29 18:31:10 +0000
commit20accf4d06dfe020f6773a302b05491177c46ff3 (patch)
treeded9ee9903271bde7bc81107fa5c11f6852f1add /clientserver.c
parent3fac51e21e7635a87687288ee7da821c41d72031 (diff)
downloadandroid_external_rsync-20accf4d06dfe020f6773a302b05491177c46ff3.tar.gz
android_external_rsync-20accf4d06dfe020f6773a302b05491177c46ff3.tar.bz2
android_external_rsync-20accf4d06dfe020f6773a302b05491177c46ff3.zip
- Use BIGPATHBUFLEN for the length of two line buffers.
- Improved the handling of the start_glob variable. - Made the line buffer in start_daemon() a little bigger.
Diffstat (limited to 'clientserver.c')
-rw-r--r--clientserver.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/clientserver.c b/clientserver.c
index 01112b48..9304f219 100644
--- a/clientserver.c
+++ b/clientserver.c
@@ -108,7 +108,7 @@ int start_inband_exchange(char *user, char *path, int f_in, int f_out,
int i;
char *sargs[MAX_ARGS];
int sargc = 0;
- char line[MAXPATHLEN];
+ char line[BIGPATHBUFLEN];
char *p;
if (argc == 0 && !am_sender)
@@ -223,7 +223,7 @@ static int rsync_module(int f_in, int f_out, int i)
int maxargs;
char **argv;
char **argp;
- char line[MAXPATHLEN];
+ char line[BIGPATHBUFLEN];
uid_t uid = (uid_t)-2; /* canonically "nobody" */
gid_t gid = (gid_t)-2;
char *p;
@@ -498,17 +498,20 @@ static int rsync_module(int f_in, int f_out, int i)
if (!(argv[argc] = strdup(p)))
out_of_memory("rsync_module");
- if (start_glob) {
- if (start_glob == 1) {
- request = strdup(p);
- start_glob++;
- }
- glob_expand(name, &argv, &argc, &maxargs);
- } else
+ switch (start_glob) {
+ case 0:
argc++;
-
- if (strcmp(line, ".") == 0)
- start_glob = 1;
+ if (strcmp(line, ".") == 0)
+ start_glob = 1;
+ break;
+ case 1:
+ request = strdup(p);
+ start_glob = 2;
+ /* FALL THROUGH */
+ default:
+ glob_expand(name, &argv, &argc, &maxargs);
+ break;
+ }
}
verbose = 0; /* future verbosity is controlled by client options */
@@ -601,7 +604,7 @@ static void send_listing(int fd)
here */
int start_daemon(int f_in, int f_out)
{
- char line[200];
+ char line[1024];
char *motd;
int i;