channel_request_pty_size: fix reqPTY_state
The state variable isn't properly set so every other call to the function fails! Bug: http://libssh2.org/mail/libssh2-devel-archive-2010-12/0096.shtml Reported by: Steve Legg
This commit is contained in:
parent
4552c73cd5
commit
0da37e0924
@ -1002,6 +1002,7 @@ channel_request_pty_size(LIBSSH2_CHANNEL * channel, int width,
|
|||||||
LIBSSH2_SESSION *session = channel->session;
|
LIBSSH2_SESSION *session = channel->session;
|
||||||
unsigned char *s;
|
unsigned char *s;
|
||||||
int rc;
|
int rc;
|
||||||
|
int retcode = LIBSSH2_ERROR_PROTO;
|
||||||
|
|
||||||
if (channel->reqPTY_state == libssh2_NB_state_idle) {
|
if (channel->reqPTY_state == libssh2_NB_state_idle) {
|
||||||
channel->reqPTY_packet_len = 39;
|
channel->reqPTY_packet_len = 39;
|
||||||
@ -1044,15 +1045,11 @@ channel_request_pty_size(LIBSSH2_CHANNEL * channel, int width,
|
|||||||
"Unable to send window-change packet");
|
"Unable to send window-change packet");
|
||||||
}
|
}
|
||||||
_libssh2_htonu32(channel->reqPTY_local_channel, channel->local.id);
|
_libssh2_htonu32(channel->reqPTY_local_channel, channel->local.id);
|
||||||
channel->reqPTY_state = libssh2_NB_state_sent;
|
retcode = LIBSSH2_ERROR_NONE;
|
||||||
|
|
||||||
return LIBSSH2_ERROR_NONE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
channel->reqPTY_state = libssh2_NB_state_idle;
|
channel->reqPTY_state = libssh2_NB_state_idle;
|
||||||
|
return retcode;
|
||||||
/* reaching this point is a protocol error of some sorts */
|
|
||||||
return LIBSSH2_ERROR_PROTO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSSH2_API int
|
LIBSSH2_API int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user