_libssh2_channel_write() only sends the 32K first bytes
In theory we could split larger buffers into several smaller packets to pass to transport_write(), but for now we instead only deal with the first 32K in this call and assume the app will call this function again with the rest! The 32K size is a conservative limit based on the text in RFC4253 section 6.1.
Этот коммит содержится в:
родитель
692401633a
Коммит
7c139633a1
@ -1948,6 +1948,14 @@ _libssh2_channel_write(LIBSSH2_CHANNEL *channel, int stream_id,
|
|||||||
int rc;
|
int rc;
|
||||||
ssize_t wrote = 0; /* counter for this specific this call */
|
ssize_t wrote = 0; /* counter for this specific this call */
|
||||||
|
|
||||||
|
/* In theory we could split larger buffers into several smaller packets,
|
||||||
|
* but for now we instead only deal with the first 32K in this call and
|
||||||
|
* assume the app will call it again with the rest! The 32K is a
|
||||||
|
* conservative limit based on the text in RFC4253 section 6.1.
|
||||||
|
*/
|
||||||
|
if(buflen > 32768)
|
||||||
|
buflen = 32768;
|
||||||
|
|
||||||
if (channel->write_state == libssh2_NB_state_idle) {
|
if (channel->write_state == libssh2_NB_state_idle) {
|
||||||
channel->write_bufwrote = 0;
|
channel->write_bufwrote = 0;
|
||||||
|
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user