Przeglądaj źródła

File reading : fix issue with reading data over the 4GiB limit

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Sylver Bruneau 9 lat temu
rodzic
commit
c7b19d5d21
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      src/smb_file.c
  2. 1 1
      src/smb_types.h

+ 1 - 1
src/smb_file.c

@@ -194,7 +194,7 @@ ssize_t   smb_fread(smb_session *s, smb_fd fd, void *buf, size_t buf_size)
     req.min_count        = max_read;
     req.max_count_high   = 0;
     req.remaining        = 0;
-    req.offset_high      = 0;
+    req.offset_high      = (file->readp >> 32) & 0xffffffff;
     req.bct              = 0;
     SMB_MSG_PUT_PKT(req_msg, req);
 

+ 1 - 1
src/smb_types.h

@@ -64,7 +64,7 @@ struct smb_file
     uint64_t            alloc_size;
     uint64_t            size;
     uint32_t            attr;
-    uint32_t            readp;          // Current read pointer (position);
+    uint64_t            readp;          // Current read pointer (position);
     int                 is_dir;         // 0 -> file, 1 -> directory
 };