simplify code by removing code duplication
Этот коммит содержится в:
родитель
13e920d4ef
Коммит
c1b687c9e4
@ -399,18 +399,12 @@ channel_direct_tcpip(LIBSSH2_SESSION * session, const char *host,
|
|||||||
/* by default we set (keep?) idle state... */
|
/* by default we set (keep?) idle state... */
|
||||||
session->direct_state = libssh2_NB_state_idle;
|
session->direct_state = libssh2_NB_state_idle;
|
||||||
|
|
||||||
if (!channel) {
|
if (!channel &&
|
||||||
if (libssh2_session_last_errno(session) == LIBSSH2_ERROR_EAGAIN) {
|
libssh2_session_last_errno(session) == LIBSSH2_ERROR_EAGAIN) {
|
||||||
/* The error code is still set to LIBSSH2_ERROR_EAGAIN,
|
/* The error code is still set to LIBSSH2_ERROR_EAGAIN, set our state
|
||||||
set our state to created to avoid re-creating the package
|
to created to avoid re-creating the package on next invoke */
|
||||||
on next invoke */
|
session->direct_state = libssh2_NB_state_created;
|
||||||
session->direct_state = libssh2_NB_state_created;
|
return NULL;
|
||||||
return NULL;
|
|
||||||
} else {
|
|
||||||
LIBSSH2_FREE(session, session->direct_message);
|
|
||||||
session->direct_message = NULL;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSSH2_FREE(session, session->direct_message);
|
LIBSSH2_FREE(session, session->direct_message);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user