File: ffs_sftp.patch

package info (click to toggle)
freefilesync 13.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,044 kB
  • sloc: cpp: 66,712; ansic: 447; makefile: 216
file content (29 lines) | stat: -rw-r--r-- 1,830 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Description: Add values from missing constants taken from libssh2
 The upstream author observed that some of the values he uses are not in the
 libssh2 public headers. I don't know where he uses them from, but I had to
 replace them here to get this to compile.
 .
 https://github.com/libssh2/libssh2/issues/90
 .
 Required since 10.9
Source: <none>
Author: B Stack
Date: 2021-02-02T18:08:53Z
Forwarded: https://freefilesync.org/forum/viewtopic.php?t=7426

--- a/FreeFileSync/Source/afs/sftp.cpp
+++ b/FreeFileSync/Source/afs/sftp.cpp
@@ -65,9 +65,10 @@
 
 //attention: if operation fails due to time out, e.g. file copy, the cleanup code may hang, too => total delay = 2 x time out interval
 
-const size_t SFTP_OPTIMAL_BLOCK_SIZE_READ  = 16 * MAX_SFTP_READ_SIZE;     //https://github.com/libssh2/libssh2/issues/90
-const size_t SFTP_OPTIMAL_BLOCK_SIZE_WRITE = 16 * MAX_SFTP_OUTGOING_SIZE; //need large buffer to mitigate libssh2 stupidly waiting on "acks": https://www.libssh2.org/libssh2_sftp_write.html
-static_assert(MAX_SFTP_READ_SIZE == 30000 && MAX_SFTP_OUTGOING_SIZE == 30000, "reevaluate optimal block sizes if these constants change!");
+// these values are all manually derived from https://github.com/libssh2/libssh2/blob/master/src/sftp.h which for some weak reason are not included in the libssh2-devel headers.
+const size_t SFTP_OPTIMAL_BLOCK_SIZE_READ  = 16 * 30000;     //https://github.com/libssh2/libssh2/issues/90
+const size_t SFTP_OPTIMAL_BLOCK_SIZE_WRITE = 16 * 30000; //need large buffer to mitigate libssh2 stupidly waiting on "acks": https://www.libssh2.org/libssh2_sftp_write.html
+//static_assert(MAX_SFTP_READ_SIZE == 30000 && MAX_SFTP_OUTGOING_SIZE == 30000, "reevaluate optimal block sizes if these constants change!");
 
 /* Perf Test, Sourceforge frs, SFTP upload, compressed 25 MB test file: