Fix missing _libssh2_error
in _libssh2_channel_write
.
In one case, the error code from `_libssh2_transport_read` was being returned from `_libssh2_channel_write` without setting it as the last error by calling `_libssh2_error`. This commit fixes that. Found when using a session whose socket had been inadvertently destroyed. The calling code got confused because via `libssh2_session_last_error` it appeared no error had occurred, despite one being returned from the previous function.
Этот коммит содержится в:
родитель
61df22c460
Коммит
88366b5ec2
@ -2023,8 +2023,10 @@ _libssh2_channel_write(LIBSSH2_CHANNEL *channel, int stream_id,
|
||||
rc = _libssh2_transport_read(session);
|
||||
while (rc > 0);
|
||||
|
||||
if((rc < 0) && (rc != LIBSSH2_ERROR_EAGAIN))
|
||||
return rc;
|
||||
if((rc < 0) && (rc != LIBSSH2_ERROR_EAGAIN)) {
|
||||
return _libssh2_error(channel->session, rc,
|
||||
"Failure while draining incoming flow");
|
||||
}
|
||||
|
||||
if(channel->local.window_size <= 0) {
|
||||
/* there's no room for data so we stop */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user