mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
channels: Set the max packet size to 32768.
(cherry picked from commit 790b62bca5)
This commit is contained in:
@@ -48,6 +48,14 @@
|
|||||||
#define WINDOWBASE 128000
|
#define WINDOWBASE 128000
|
||||||
#define WINDOWLIMIT (WINDOWBASE/2)
|
#define WINDOWLIMIT (WINDOWBASE/2)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* All implementations MUST be able to process packets with an
|
||||||
|
* uncompressed payload length of 32768 bytes or less and a total packet
|
||||||
|
* size of 35000 bytes or less.
|
||||||
|
*/
|
||||||
|
#define CHANNEL_MAX_PACKET 32768
|
||||||
|
#define CHANNEL_INITIAL_WINDOW 64000
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup libssh_channel The SSH channel functions
|
* @defgroup libssh_channel The SSH channel functions
|
||||||
* @ingroup libssh
|
* @ingroup libssh
|
||||||
@@ -877,7 +885,11 @@ int ssh_channel_open_session(ssh_channel channel) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return channel_open(channel,"session",64000,32000,NULL);
|
return channel_open(channel,
|
||||||
|
"session",
|
||||||
|
CHANNEL_INITIAL_WINDOW,
|
||||||
|
CHANNEL_MAX_PACKET,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -952,7 +964,11 @@ int ssh_channel_open_forward(ssh_channel channel, const char *remotehost,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = channel_open(channel, "direct-tcpip", 64000, 32000, payload);
|
rc = channel_open(channel,
|
||||||
|
"direct-tcpip",
|
||||||
|
CHANNEL_INITIAL_WINDOW,
|
||||||
|
CHANNEL_MAX_PACKET,
|
||||||
|
payload);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
ssh_buffer_free(payload);
|
ssh_buffer_free(payload);
|
||||||
@@ -2803,7 +2819,11 @@ int ssh_channel_open_reverse_forward(ssh_channel channel, const char *remotehost
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = channel_open(channel, "forwarded-tcpip", 64000, 32000, payload);
|
rc = channel_open(channel,
|
||||||
|
"forwarded-tcpip",
|
||||||
|
CHANNEL_INITIAL_WINDOW,
|
||||||
|
CHANNEL_MAX_PACKET,
|
||||||
|
payload);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
ssh_buffer_free(payload);
|
ssh_buffer_free(payload);
|
||||||
|
|||||||
Reference in New Issue
Block a user