}
if (verbose > 2)
---- orig/main.c 2004-07-17 15:20:05
+--- orig/main.c 2004-07-19 17:14:44
+++ main.c 2004-07-17 15:58:11
@@ -57,6 +57,7 @@ extern int filesfrom_fd;
extern pid_t cleanup_child_pid;
get_redo_num(); /* Read final MSG_DONE and any prior messages. */
report(-1);
---- orig/receiver.c 2004-07-16 20:07:22
-+++ receiver.c 2004-07-17 21:27:55
+--- orig/receiver.c 2004-07-19 17:06:10
++++ receiver.c 2004-07-19 16:44:39
@@ -28,6 +28,7 @@ extern int max_delete;
extern int csum_length;
extern struct stats stats;
extern int am_server;
extern int relative_paths;
extern int keep_dirlinks;
-@@ -299,13 +300,38 @@ static int receive_data(int f_in,struct
- return 1;
+@@ -303,6 +304,30 @@ static int receive_data(int f_in,struct
}
+
+static char *read_gen_name(int fd, char *buf, char *realname)
+{
+ int len = read_byte(fd);
+ return realname;
+}
+
-
- /**
++
+ static void discard_receive_data(int f_in, OFF_T length)
+ {
+ receive_data(f_in, NULL, -1, NULL, length);
+@@ -313,8 +338,10 @@ static void discard_receive_data(int f_i
* main routine for receiver process.
*
* Receiver process runs on the same host as the generator process. */
int fd1,fd2;
STRUCT_STAT st;
char *fname, fbuf[MAXPATHLEN];
-@@ -332,8 +358,20 @@ int recv_files(int f_in, struct file_lis
+@@ -341,6 +368,17 @@ int recv_files(int f_in, struct file_lis
i = read_int(f_in);
if (i == -1) {
+
if (phase)
break;
-+
- phase = 1;
- csum_length = SUM_LENGTH;
- if (verbose > 2)
-@@ -373,19 +411,31 @@ int recv_files(int f_in, struct file_lis
+
+@@ -383,7 +421,26 @@ int recv_files(int f_in, struct file_lis
if (verbose > 2)
rprintf(FINFO,"recv_files(%s)\n",fname);
+ next_gen_i = read_int(f_name_in);
+ }
+ if (i < next_gen_i) {
-+ rprintf(FINFO, "skipping update for %s\n",
++ rprintf(FINFO, "skipping update for \"%s\"\n",
+ fname);
-+ receive_data(f_in,NULL,-1,NULL,file->length);
++ discard_receive_data(f_in, file->length);
+ continue;
+ }
+ next_gen_i = -1;
+ fnamecmp = read_gen_name(f_name_in, fnamecmpbuf, fname);
+ else
+ fnamecmp = fname;
-+
+ if (server_exclude_list.head
+ && check_exclude(&server_exclude_list, fname,
+@@ -400,14 +457,6 @@ int recv_files(int f_in, struct file_lis
/* open the file */
fd1 = do_open(fnamecmp, O_RDONLY, 0);
if (files_from && (!am_sender || remote_filesfrom_file)) {
if (remote_filesfrom_file) {
args[ac++] = "--files-from";
---- orig/receiver.c 2004-07-16 20:07:22
-+++ receiver.c 2004-07-16 20:16:37
+--- orig/receiver.c 2004-07-19 17:06:10
++++ receiver.c 2004-07-19 17:07:31
@@ -37,6 +37,7 @@ extern int cvs_exclude;
extern int io_error;
extern char *tmpdir;
extern int make_backups;
extern int do_progress;
extern char *backup_dir;
-@@ -197,10 +198,11 @@ static int get_tmpname(char *fnametmp, c
+@@ -200,10 +201,11 @@ static int get_tmpname(char *fnametmp, c
static int receive_data(int f_in,struct map_struct *mapbuf,int fd,char *fname,
unsigned int len;
OFF_T offset = 0;
OFF_T offset2;
-@@ -211,6 +213,9 @@ static int receive_data(int f_in,struct
+@@ -214,6 +216,9 @@ static int receive_data(int f_in,struct
read_sum_head(f_in, &sum);
sum_init(checksum_seed);
while ((i = recv_token(f_in, &data)) != 0) {
-@@ -227,6 +232,8 @@ static int receive_data(int f_in,struct
+@@ -230,6 +235,8 @@ static int receive_data(int f_in,struct
cleanup_got_literal = 1;
sum_update(data,i);
if (fd != -1 && write_file(fd,data,i) != i) {
rsyserr(FERROR, errno, "write failed on %s",
-@@ -254,6 +261,8 @@ static int receive_data(int f_in,struct
+@@ -257,6 +264,8 @@ static int receive_data(int f_in,struct
see_token(map, len);
sum_update(map,len);
}
if (!inplace || offset != offset2) {
-@@ -290,6 +299,8 @@ static int receive_data(int f_in,struct
+@@ -293,6 +302,8 @@ static int receive_data(int f_in,struct
}
sum_end(file_sum1);
read_buf(f_in,file_sum2,MD4_SUM_LENGTH);
if (verbose > 2)
-@@ -389,7 +400,7 @@ int recv_files(int f_in, struct file_lis
- if (fd1 != -1 && do_fstat(fd1,&st) != 0) {
- rsyserr(FERROR, errno, "fstat %s failed",
- full_fname(fnamecmp));
-- receive_data(f_in,NULL,-1,NULL,file->length);
-+ receive_data(f_in,NULL,-1,NULL,file->length,NULL);
- close(fd1);
- continue;
- }
-@@ -402,7 +413,7 @@ int recv_files(int f_in, struct file_lis
- */
- rprintf(FERROR,"recv_files: %s is a directory\n",
- full_fname(fnamecmp));
-- receive_data(f_in, NULL, -1, NULL, file->length);
-+ receive_data(f_in,NULL,-1,NULL,file->length,NULL);
- close(fd1);
- continue;
- }
-@@ -435,7 +446,7 @@ int recv_files(int f_in, struct file_lis
- if (fd2 == -1) {
- rsyserr(FERROR, errno, "open %s failed",
- full_fname(fnamecmp));
-- receive_data(f_in,mapbuf,-1,NULL,file->length);
-+ receive_data(f_in,mapbuf,-1,NULL,file->length,NULL);
- if (mapbuf)
- unmap_file(mapbuf);
- if (fd1 != -1)
-@@ -472,7 +483,7 @@ int recv_files(int f_in, struct file_lis
- if (fd2 == -1) {
- rsyserr(FERROR, errno, "mkstemp %s failed",
- full_fname(fnametmp));
-- receive_data(f_in,mapbuf,-1,NULL,file->length);
-+ receive_data(f_in,mapbuf,-1,NULL,file->length,NULL);
- if (mapbuf)
- unmap_file(mapbuf);
- if (fd1 != -1)
-@@ -487,7 +498,11 @@ int recv_files(int f_in, struct file_lis
+@@ -305,7 +316,7 @@ static int receive_data(int f_in,struct
+
+ static void discard_receive_data(int f_in, OFF_T length)
+ {
+- receive_data(f_in, NULL, -1, NULL, length);
++ receive_data(f_in, NULL, -1, NULL, length, NULL);
+ }
+
+
+@@ -510,7 +521,11 @@ int recv_files(int f_in, struct file_lis
rprintf(FINFO, "%s\n", fname);
/* recv file data */