1
1

- (Feb 20 2009) libssh2_channel_direct_tcpip_ex() bug #1902169 fixed, which

caused it to fail when called a second time.
Этот коммит содержится в:
Daniel Stenberg 2009-02-20 16:14:45 +00:00
родитель d722e09196
Коммит 1addcbbf53
2 изменённых файлов: 12 добавлений и 4 удалений

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

@ -1,4 +1,7 @@
- (Feb 20 2009) libssh2_channel_direct_tcpip_ex() bug #1902169 fixed, which
caused it to fail when called a second time.
- (Feb 12 2009) Romain Bondue extended Markus Moeller fix from Feb 8, based on - (Feb 12 2009) Romain Bondue extended Markus Moeller fix from Feb 8, based on
a previous (uncommitted) patch by Erik Brossler. It improves a previous (uncommitted) patch by Erik Brossler. It improves
libssh2_channel_write_ex in blocking situations when the socket is set non- libssh2_channel_write_ex in blocking situations when the socket is set non-

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

@ -1,5 +1,5 @@
/* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org> /* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
* Copyright (c) 2008 by Daniel Stenberg * Copyright (c) 2008-2009 by Daniel Stenberg
* *
* All rights reserved. * All rights reserved.
* *
@ -368,8 +368,6 @@ libssh2_channel_direct_tcpip_ex(LIBSSH2_SESSION * session, const char *host,
s += session->direct_shost_len; s += session->direct_shost_len;
libssh2_htonu32(s, sport); libssh2_htonu32(s, sport);
s += 4; s += 4;
session->direct_state = libssh2_NB_state_created;
} }
channel = channel =
@ -379,9 +377,16 @@ libssh2_channel_direct_tcpip_ex(LIBSSH2_SESSION * session, const char *host,
LIBSSH2_CHANNEL_PACKET_DEFAULT, LIBSSH2_CHANNEL_PACKET_DEFAULT,
(char *) session->direct_message, (char *) session->direct_message,
session->direct_message_len); session->direct_message_len);
/* by default we set (keep?) idle state... */
session->direct_state = libssh2_NB_state_idle;
if (!channel) { if (!channel) {
if (libssh2_session_last_errno(session) == LIBSSH2_ERROR_EAGAIN) { if (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 to created to avoid re-creating the package
on next invoke */
session->direct_state = libssh2_NB_state_created;
return NULL; return NULL;
} else { } else {
LIBSSH2_FREE(session, session->direct_message); LIBSSH2_FREE(session, session->direct_message);