Skip to content

Commit

Permalink
Increase limit for 'max_write' and 'max_read' almost twice, make it d…
Browse files Browse the repository at this point in the history
…epend on MAX_REPLY_LEN
  • Loading branch information
rozhuk-im committed Jul 10, 2022
1 parent a22d345 commit de03645
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@
#define MY_EOF 1

#define MAX_REPLY_LEN (1 << 17)
#define MAX_READ_LEN (MAX_REPLY_LEN - 9)
#define MAX_WRITE_LEN (MAX_REPLY_LEN - 16)

#define RENAME_TEMP_CHARS 8

Expand Down Expand Up @@ -4338,10 +4340,10 @@ int main(int argc, char *argv[])

sshfs.randseed = time(0);

if (sshfs.max_read > 65536)
sshfs.max_read = 65536;
if (sshfs.max_write > 65536)
sshfs.max_write = 65536;
if (sshfs.max_read > MAX_READ_LEN)
sshfs.max_read = MAX_READ_LEN;
if (sshfs.max_write > MAX_WRITE_LEN)
sshfs.max_write = MAX_WRITE_LEN;

fsname = fsname_escape_commas(fsname);
tmp = g_strdup_printf("-osubtype=sshfs,fsname=%s", fsname);
Expand Down

0 comments on commit de03645

Please sign in to comment.