- Call the new {read,write}_varlong30() names for the long-int
authorWayne Davison <wayned@samba.org>
Fri, 20 Apr 2007 08:17:03 +0000 (08:17 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 20 Apr 2007 08:17:03 +0000 (08:17 +0000)
  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

diff --git a/flist.c b/flist.c
index aa1efac..eda6d99 100644 (file)
--- 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));