diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-06-30 04:29:46 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-06-30 04:29:46 +0000 |
commit | aae43eb38f8c49c8ac675f8269b06d11a72bd10e (patch) | |
tree | d3970e5058d47dfa392aed5fc35ca7c3de7f3a2d /compat.c | |
parent | dc5ddbccace1f4f37d57ce5d961117effc28a356 (diff) | |
download | rsync-aae43eb38f8c49c8ac675f8269b06d11a72bd10e.tar.gz |
added checksum seed
Diffstat (limited to 'compat.c')
-rw-r--r-- | compat.c | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -21,6 +21,8 @@ #include "rsync.h" +extern int am_server; + extern int csum_length; extern int preserve_links; @@ -30,6 +32,7 @@ extern int preserve_uid; extern int preserve_gid; extern int preserve_times; extern int always_checksum; +extern int checksum_seed; extern int remote_version; @@ -180,8 +183,24 @@ void receive_file_entry_v10(struct file_struct *file, -void setup_protocol(void) +void setup_protocol(int f_out,int f_in) { + if (am_server) { + remote_version = read_int(f_in); + write_int(f_out,PROTOCOL_VERSION); + write_flush(f_out); + } else { + write_int(f_out,PROTOCOL_VERSION); + write_flush(f_out); + remote_version = read_int(f_in); + } + + if (remote_version < MIN_PROTOCOL_VERSION || + remote_version > MAX_PROTOCOL_VERSION) { + fprintf(FERROR,"protocol version mismatch - is your shell clean?\n"); + exit_cleanup(1); + } + if (remote_version == 10) { send_file_entry = send_file_entry_v10; receive_file_entry = receive_file_entry_v10; @@ -189,5 +208,14 @@ void setup_protocol(void) send_file_entry = send_file_entry_v11; receive_file_entry = receive_file_entry_v11; } + + if (remote_version >= 12) { + if (am_server) { + checksum_seed = time(NULL); + write_int(f_out,checksum_seed); + } else { + checksum_seed = read_int(f_in); + } + } } |