1
1

libssh2_channel_forward_accept() and listening fixes

The forward accepting was not done right before, and the
packet_queue_listener function didn't assign a necessary
variable. All fixed by Juzna. I (Daniel) modified the
forward_accept() change somewhat.
Этот коммит содержится в:
Juzna 2009-10-18 03:41:25 +02:00 коммит произвёл Daniel Stenberg
родитель 0c13f7beda
Коммит 1e80194b97
2 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -725,11 +725,6 @@ channel_forward_accept(LIBSSH2_LISTENER *listener)
do {
rc = _libssh2_transport_read(listener->session);
if (rc == PACKET_EAGAIN) {
libssh2_error(listener->session, LIBSSH2_ERROR_EAGAIN,
"Would block waiting for packet", 0);
return NULL;
}
} while (rc > 0);
if (_libssh2_list_first(&listener->queue)) {
@ -746,8 +741,13 @@ channel_forward_accept(LIBSSH2_LISTENER *listener)
return channel;
}
libssh2_error(listener->session, LIBSSH2_ERROR_CHANNEL_UNKNOWN,
"Channel not found", 0);
if (rc == PACKET_EAGAIN) {
libssh2_error(listener->session, LIBSSH2_ERROR_EAGAIN,
"Would block waiting for packet", 0);
}
else
libssh2_error(listener->session, LIBSSH2_ERROR_CHANNEL_UNKNOWN,
"Channel not found", 0);
return NULL;
}

Просмотреть файл

@ -146,6 +146,8 @@ packet_queue_listener(LIBSSH2_SESSION * session, unsigned char *data,
listen_state->state = libssh2_NB_state_sent;
break;
}
listen_state->channel = channel;
memset(channel, 0, sizeof(LIBSSH2_CHANNEL));
channel->session = session;