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.
This commit is contained in:
parent
8c43bc52b1
commit
b228f132f7
@ -1189,14 +1189,15 @@ libssh2_poll_channel_read(LIBSSH2_CHANNEL * channel, int extended)
|
|||||||
LIBSSH2_SESSION *session = channel->session;
|
LIBSSH2_SESSION *session = channel->session;
|
||||||
LIBSSH2_PACKET *packet = session->packets.head;
|
LIBSSH2_PACKET *packet = session->packets.head;
|
||||||
|
|
||||||
while (packet) {
|
while (packet)
|
||||||
if (((packet->data[0] == SSH_MSG_CHANNEL_DATA) && (extended == 0) &&
|
{
|
||||||
(channel->local.id == libssh2_ntohu32(packet->data + 1))) ||
|
if ( channel->local.id == libssh2_ntohu32(packet->data + 1)) {
|
||||||
((packet->data[0] == SSH_MSG_CHANNEL_EXTENDED_DATA)
|
if ( extended == 1 &&
|
||||||
&& (extended != 0)
|
(packet->data[0] == SSH_MSG_CHANNEL_EXTENDED_DATA || packet->data[0] == SSH_MSG_CHANNEL_DATA ))
|
||||||
&& (channel->local.id == libssh2_ntohu32(packet->data + 1)))) {
|
return 1;
|
||||||
/* Found data waiting to be read */
|
else if ( extended == 0 && packet->data[0] == SSH_MSG_CHANNEL_DATA)
|
||||||
return 1;
|
return 1;
|
||||||
|
//else - no data of any type is ready to be read
|
||||||
}
|
}
|
||||||
packet = packet->next;
|
packet = packet->next;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user