Fixed an issue with the libssh2_poll_channel_read function not
reading both normal and extended data when a non-zero value is passed in as the 2nd parameter. This now matches the functionallity described in the documentation.
Этот коммит содержится в:
родитель
8c43bc52b1
Коммит
b228f132f7
@ -1189,14 +1189,15 @@ libssh2_poll_channel_read(LIBSSH2_CHANNEL * channel, int extended)
|
||||
LIBSSH2_SESSION *session = channel->session;
|
||||
LIBSSH2_PACKET *packet = session->packets.head;
|
||||
|
||||
while (packet) {
|
||||
if (((packet->data[0] == SSH_MSG_CHANNEL_DATA) && (extended == 0) &&
|
||||
(channel->local.id == libssh2_ntohu32(packet->data + 1))) ||
|
||||
((packet->data[0] == SSH_MSG_CHANNEL_EXTENDED_DATA)
|
||||
&& (extended != 0)
|
||||
&& (channel->local.id == libssh2_ntohu32(packet->data + 1)))) {
|
||||
/* Found data waiting to be read */
|
||||
return 1;
|
||||
while (packet)
|
||||
{
|
||||
if ( channel->local.id == libssh2_ntohu32(packet->data + 1)) {
|
||||
if ( extended == 1 &&
|
||||
(packet->data[0] == SSH_MSG_CHANNEL_EXTENDED_DATA || packet->data[0] == SSH_MSG_CHANNEL_DATA ))
|
||||
return 1;
|
||||
else if ( extended == 0 && packet->data[0] == SSH_MSG_CHANNEL_DATA)
|
||||
return 1;
|
||||
//else - no data of any type is ready to be read
|
||||
}
|
||||
packet = packet->next;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user