From ba59bd68fca726026a07806d6625443163c40aef Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 20 Apr 2007 08:17:03 +0000 Subject: [PATCH] - Call the new {read,write}_varlong30() names for the long-int functions that are protocol sensitive. - Changed the sending of the time value in protocol 30 to support 64-bit values without bloating positive 32-bit values. --- flist.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/flist.c b/flist.c index aa1efac3..eda6d994 100644 --- a/flist.c +++ b/flist.c @@ -481,9 +481,13 @@ static void send_file_entry(int f, struct file_struct *file, int ndx) goto the_end; } - write_longint(f, F_LENGTH(file)); - if (!(flags & XMIT_SAME_TIME)) - write_int(f, modtime); + write_varlong30(f, F_LENGTH(file), 3); + if (!(flags & XMIT_SAME_TIME)) { + if (protocol_version >= 30) + write_varlong(f, modtime, 4); + else + write_int(f, modtime); + } if (!(flags & XMIT_SAME_MODE)) write_int(f, to_wire_mode(mode)); if (preserve_uid && !(flags & XMIT_SAME_UID)) { @@ -665,9 +669,13 @@ static struct file_struct *recv_file_entry(struct file_list *flist, } #endif - file_length = read_longint(f); - if (!(flags & XMIT_SAME_TIME)) - modtime = (time_t)read_int(f); + file_length = read_varlong30(f, 3); + if (!(flags & XMIT_SAME_TIME)) { + if (protocol_version >= 30) + modtime = (time_t)read_varlong(f, 4); + else + modtime = (time_t)read_int(f); + } if (!(flags & XMIT_SAME_MODE)) mode = from_wire_mode(read_int(f)); -- 2.34.1