Fix header functions and add return value checks.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@430 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
родитель
8948bf41f1
Коммит
da1eee8c89
@ -680,7 +680,7 @@ int channel_request_pty_size1(CHANNEL *channel, char *terminal,int cols,
|
||||
int channel_change_pty_size1(CHANNEL *channel, int cols, int rows);
|
||||
int channel_request_shell1(CHANNEL *channel);
|
||||
int channel_request_exec1(CHANNEL *channel, char *cmd);
|
||||
void channel_handle1(SSH_SESSION *session,int type);
|
||||
int channel_handle1(SSH_SESSION *session, int type);
|
||||
int channel_write1(CHANNEL *channel, void *data, int len);
|
||||
|
||||
/* session.c */
|
||||
|
@ -283,7 +283,9 @@ int channel_handle1(SSH_SESSION *session, int type) {
|
||||
}
|
||||
break;
|
||||
case SSH_SMSG_EXITSTATUS:
|
||||
channel_rcv_close1(session);
|
||||
if (channel_rcv_close1(session) < 0) {
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ssh_log(session, SSH_LOG_FUNCTIONS, "Unexepected message %d", type);
|
||||
|
@ -460,7 +460,9 @@ void packet_parse(SSH_SESSION *session){
|
||||
case SSH_SMSG_STDOUT_DATA:
|
||||
case SSH_SMSG_STDERR_DATA:
|
||||
case SSH_SMSG_EXITSTATUS:
|
||||
channel_handle1(session,type);
|
||||
if (channel_handle1(session,type) < 0) {
|
||||
return;
|
||||
}
|
||||
return;
|
||||
case SSH_MSG_DEBUG:
|
||||
case SSH_MSG_IGNORE:
|
||||
@ -525,7 +527,10 @@ static int packet_wait1(SSH_SESSION *session,int type,int blocking){
|
||||
case SSH_SMSG_STDOUT_DATA:
|
||||
case SSH_SMSG_STDERR_DATA:
|
||||
case SSH_SMSG_EXITSTATUS:
|
||||
channel_handle1(session,type);
|
||||
if (channel_handle1(session,type) < 0) {
|
||||
leave_function();
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case SSH_MSG_DEBUG:
|
||||
case SSH_MSG_IGNORE:
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user