From 3e4916822d35de3886f04ac4dc6d86ee29f177af Mon Sep 17 00:00:00 2001 From: "J.W. Schultz" Date: Tue, 10 Feb 2004 03:54:47 +0000 Subject: [PATCH] Dropped support for protocol versions less than 20 (2.3.0 released 15 Mar 1999) and activated warnings for protocols less than 25 (2.5.0 released 23 Aug 2001) --- NEWS | 6 ++++-- flist.c | 22 +++++++++++----------- main.c | 12 ++---------- rsync.h | 4 ++-- 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/NEWS b/NEWS index 82f734b5..de01d4a5 100644 --- a/NEWS +++ b/NEWS @@ -89,8 +89,10 @@ Changes since 2.6.0: earlier in the list than the files that are already present on the receiving side. - * Got rid of support for protocol versions 17 and 18 (which are - both over 6 years old). (Wayne Davison) + * Dropped support for protocol versions less than 20 + (2.3.0 released 15 Mar 1999) and activated warnings for + protocols less than 25 (2.5.0 released 23 Aug 2001) + (Wayne Davison and J.W. Schultz, severally) * More optimal data transmission for --hard-links (protocol 28). diff --git a/flist.c b/flist.c index 19931a5f..415de19b 100644 --- a/flist.c +++ b/flist.c @@ -361,7 +361,7 @@ void send_file_entry(struct file_struct *file, int f, unsigned short base_flags) /* Set both flags to simplify the test * when writing the data. */ flags |= XMIT_SAME_RDEV_pre28 - | XMIT_SAME_HIGH_RDEV; + | XMIT_SAME_HIGH_RDEV; } else rdev = file->u.rdev; } else @@ -400,8 +400,8 @@ void send_file_entry(struct file_struct *file, int f, unsigned short base_flags) #endif for (l1 = 0; - lastname[l1] && (fname[l1] == lastname[l1]) && (l1 < 255); - l1++) {} + lastname[l1] && (fname[l1] == lastname[l1]) && (l1 < 255); + l1++) {} l2 = strlen(fname+l1); if (l1 > 0) @@ -494,8 +494,8 @@ void send_file_entry(struct file_struct *file, int f, unsigned short base_flags) } else sum = NULL; if (sum) { - write_buf(f, sum, protocol_version < 21? 2 - : MD4_SUM_LENGTH); + write_buf(f, sum, + protocol_version < 21 ? 2 : MD4_SUM_LENGTH); } } @@ -689,8 +689,8 @@ void receive_file_entry(struct file_struct **fptr, unsigned short flags, } else sum = NULL; if (sum) { - read_buf(f, sum, protocol_version < 21? 2 - : MD4_SUM_LENGTH); + read_buf(f, sum, + protocol_version < 21 ? 2 : MD4_SUM_LENGTH); } } @@ -783,7 +783,7 @@ struct file_struct *make_file(char *fname, if (lp_ignore_nonreadable(module_id) && access(thisname, R_OK) != 0) return NULL; - skip_excludes: +skip_excludes: if (verbose > 2) { rprintf(FINFO, "[%s] make_file(%s,*,%d)\n", @@ -1291,7 +1291,7 @@ struct file_list *recv_file_list(int f) return flist; - oom: +oom: out_of_memory("recv_file_list"); return NULL; /* not reached */ } @@ -1370,7 +1370,7 @@ struct file_list *flist_new(int with_hlink, char *msg) #if SUPPORT_HARD_LINKS if (with_hlink && preserve_hard_links) { - if (!(flist->hlink_pool = pool_create(HLINK_EXTENT, + if (!(flist->hlink_pool = pool_create(HLINK_EXTENT, sizeof (struct idev), out_of_memory, POOL_INTERN))) out_of_memory(msg); } @@ -1403,7 +1403,7 @@ static void clean_flist(struct file_list *flist, int strip_root, int no_dups) return; qsort(flist->files, flist->count, - sizeof flist->files[0], (int (*)()) file_compare); + sizeof flist->files[0], (int (*)()) file_compare); for (i = no_dups? 0 : flist->count; i < flist->count; i++) { if (flist->files[i]->basename) { diff --git a/main.c b/main.c index e26c7b16..5ad1bf20 100644 --- a/main.c +++ b/main.c @@ -108,7 +108,6 @@ void wait_process(pid_t pid, int *status) static void report(int f) { time_t t = time(NULL); - int send_stats; if (do_stats && verbose > 1) { /* These come out from every process */ @@ -124,9 +123,8 @@ static void report(int f) if (f == -1 || !am_sender) return; } - send_stats = verbose || protocol_version >= 20; if (am_server) { - if (am_sender && send_stats) { + if (am_sender) { int64 w; /* store total_written in a temporary * because write_longint changes it */ @@ -140,7 +138,7 @@ static void report(int f) /* this is the client */ - if (!am_sender && send_stats) { + if (!am_sender) { int64 r; stats.total_written = read_longint(f); /* store total_read in a temporary, read_longint changes it */ @@ -150,12 +148,6 @@ static void report(int f) } if (do_stats) { - if (!am_sender && !send_stats) { - /* missing the bytes written by the generator */ - rprintf(FINFO, "\nCannot show stats as receiver because remote protocol version is less than 20\n"); - rprintf(FINFO, "Use --stats -v to show stats\n"); - return; - } rprintf(FINFO,"\nNumber of files: %d\n", stats.num_files); rprintf(FINFO,"Number of files transferred: %d\n", stats.num_transferred_files); diff --git a/rsync.h b/rsync.h index 37a5d531..633189df 100644 --- a/rsync.h +++ b/rsync.h @@ -80,8 +80,8 @@ * unlikely to begin by sending a byte between MIN_PROTOCL_VERSION and * MAX_PROTOCOL_VERSION. */ -#define MIN_PROTOCOL_VERSION 19 -#define OLD_PROTOCOL_VERSION 20 +#define MIN_PROTOCOL_VERSION 20 +#define OLD_PROTOCOL_VERSION 25 #define MAX_PROTOCOL_VERSION 40 #define RSYNC_PORT 873 -- 2.34.1