1
1

removed the libssh2pack_t type

and a minor _libssh2_transport_read() simplification
Этот коммит содержится в:
Daniel Stenberg 2009-08-24 23:50:53 +02:00
родитель 9e96acf86e
Коммит f1e010f5d4
3 изменённых файлов: 6 добавлений и 12 удалений

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

@ -194,8 +194,6 @@ typedef struct _LIBSSH2_COMP_METHOD LIBSSH2_COMP_METHOD;
typedef struct _LIBSSH2_PACKET LIBSSH2_PACKET; typedef struct _LIBSSH2_PACKET LIBSSH2_PACKET;
typedef int libssh2pack_t;
typedef enum typedef enum
{ {
libssh2_NB_state_idle = 0, libssh2_NB_state_idle = 0,

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

@ -259,10 +259,9 @@ fullpacket(LIBSSH2_SESSION * session, int encrypted /* 1 or 0 */ )
* *
* DOES NOT call libssh2_error() for ANY error case. * DOES NOT call libssh2_error() for ANY error case.
*/ */
libssh2pack_t int _libssh2_transport_read(LIBSSH2_SESSION * session)
_libssh2_transport_read(LIBSSH2_SESSION * session)
{ {
libssh2pack_t rc = -1; int rc = LIBSSH2_ERROR_SOCKET_NONE;
struct transportpacket *p = &session->packet; struct transportpacket *p = &session->packet;
int remainbuf; int remainbuf;
int remainpack; int remainpack;
@ -271,7 +270,6 @@ _libssh2_transport_read(LIBSSH2_SESSION * session)
unsigned char block[MAX_BLOCKSIZE]; unsigned char block[MAX_BLOCKSIZE];
int blocksize; int blocksize;
int encrypted = 1; int encrypted = 1;
int status;
/* default clear the bit */ /* default clear the bit */
session->socket_block_directions &= ~LIBSSH2_SESSION_BLOCK_INBOUND; session->socket_block_directions &= ~LIBSSH2_SESSION_BLOCK_INBOUND;
@ -296,11 +294,9 @@ _libssh2_transport_read(LIBSSH2_SESSION * session)
*/ */
_libssh2_debug(session, LIBSSH2_DBG_TRANS, "Redirecting into the" _libssh2_debug(session, LIBSSH2_DBG_TRANS, "Redirecting into the"
" key re-exchange"); " key re-exchange");
status = libssh2_kex_exchange(session, 1, &session->startup_key_state); rc = libssh2_kex_exchange(session, 1, &session->startup_key_state);
if (status == PACKET_EAGAIN) if (rc)
return PACKET_EAGAIN; return rc;
else if (status)
return LIBSSH2_ERROR_KEX_FAILURE;
} }
/* /*

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

@ -75,6 +75,6 @@ int _libssh2_transport_write(LIBSSH2_SESSION * session, unsigned char *data,
* This function reads the binary stream as specified in chapter 6 of RFC4253 * This function reads the binary stream as specified in chapter 6 of RFC4253
* "The Secure Shell (SSH) Transport Layer Protocol" * "The Secure Shell (SSH) Transport Layer Protocol"
*/ */
libssh2pack_t _libssh2_transport_read(LIBSSH2_SESSION * session); int _libssh2_transport_read(LIBSSH2_SESSION * session);
#endif /* __LIBSSH2_TRANSPORT_H */ #endif /* __LIBSSH2_TRANSPORT_H */