diff options
| author | Wayne Davison <wayned@samba.org> | 2005-02-20 01:04:51 +0000 |
|---|---|---|
| committer | Wayne Davison <wayned@samba.org> | 2005-02-20 01:04:51 +0000 |
| commit | 3e870a64440a8244fb60fe69b2401d2dec90ce08 (patch) | |
| tree | d2d9a4dfb1f293cb2043415fd690426acc9f0950 /receiver.c | |
| parent | bf26aa22195b671e859d2c9147ffdda0a89efb98 (diff) | |
| download | android_external_rsync-3e870a64440a8244fb60fe69b2401d2dec90ce08.tar.gz android_external_rsync-3e870a64440a8244fb60fe69b2401d2dec90ce08.tar.bz2 android_external_rsync-3e870a64440a8244fb60fe69b2401d2dec90ce08.zip | |
If --remove-sent-files was specified and we successfully updated a
file, send MSG_SUCCESS to the sender (through the generator).
Diffstat (limited to 'receiver.c')
| -rw-r--r-- | receiver.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -41,6 +41,7 @@ extern int io_error; extern int basis_dir_cnt; extern int make_backups; extern int cleanup_got_literal; +extern int remove_sent_files; extern int module_id; extern int ignore_errors; extern int orig_umask; @@ -312,7 +313,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name, char *fname, fbuf[MAXPATHLEN]; char template[MAXPATHLEN]; char fnametmp[MAXPATHLEN]; - char *fnamecmp, *partialptr; + char *fnamecmp, *partialptr, numbuf[4]; char fnamecmpbuf[MAXPATHLEN]; uchar *delayed_bits = NULL; struct file_struct *file; @@ -595,7 +596,12 @@ int recv_files(int f_in, struct file_list *flist, char *local_name, cleanup_disable(); - if (!recv_ok) { + if (recv_ok) { + if (remove_sent_files) { + SIVAL(numbuf, 0, i); + send_msg(MSG_SUCCESS, numbuf, 4); + } + } else { int msgtype = csum_length == SUM_LENGTH || read_batch ? FERROR : FINFO; if (msgtype == FERROR || verbose) { @@ -619,9 +625,8 @@ int recv_files(int f_in, struct file_list *flist, char *local_name, keptstr, redostr); } if (csum_length != SUM_LENGTH) { - char buf[4]; - SIVAL(buf, 0, i); - send_msg(MSG_REDO, buf, 4); + SIVAL(numbuf, 0, i); + send_msg(MSG_REDO, numbuf, 4); } } } |
