1
1

always do "forced" window updates

When calling _libssh2_channel_receive_window_adjust() internally, we now
always use the 'force' option to prevent libssh2 to avoid sending the
update if the update isn't big enough.

It isn't fully analyzed but we have seen corner cases which made a
necessary window update not get send due to this and then the other side
doesn't send data our side then sits waiting for forever.
Этот коммит содержится в:
Daniel Stenberg 2012-04-03 22:36:19 +02:00
родитель 2ea40e63e8
Коммит acd9bd6104
3 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -1418,7 +1418,7 @@ _libssh2_channel_flush(LIBSSH2_CHANNEL *channel, int streamid)
rc = _libssh2_channel_receive_window_adjust(channel,
channel->flush_refund_bytes,
0, NULL);
1, NULL);
if (rc == LIBSSH2_ERROR_EAGAIN)
return rc;
}

Просмотреть файл

@ -661,7 +661,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
rc = _libssh2_channel_receive_window_adjust(session->
packAdd_channelp,
datalen - 13,
0, NULL);
1, NULL);
if (rc == LIBSSH2_ERROR_EAGAIN)
return rc;

Просмотреть файл

@ -285,7 +285,7 @@ sftp_packet_read(LIBSSH2_SFTP *sftp)
/* ask for twice the data amount we need at once */
rc = _libssh2_channel_receive_window_adjust(channel,
sftp->partial_len*2,
0, NULL);
1, NULL);
/* store the state so that we continue with the correct
operation at next invoke */
sftp->packet_state = (rc == LIBSSH2_ERROR_EAGAIN)?
@ -1262,7 +1262,7 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle, char *buffer,
rc = _libssh2_channel_receive_window_adjust(sftp->channel,
max_read_ahead*8,
0, NULL);
1, NULL);
/* if this returns EAGAIN, we will get back to this function
at next call */
assert(rc != LIBSSH2_ERROR_EAGAIN || !filep->data_left);