removed the libssh2pack_t type
and a minor _libssh2_transport_read() simplification
Этот коммит содержится в:
родитель
9e96acf86e
Коммит
f1e010f5d4
@ -194,8 +194,6 @@ typedef struct _LIBSSH2_COMP_METHOD LIBSSH2_COMP_METHOD;
|
||||
|
||||
typedef struct _LIBSSH2_PACKET LIBSSH2_PACKET;
|
||||
|
||||
typedef int libssh2pack_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
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.
|
||||
*/
|
||||
libssh2pack_t
|
||||
_libssh2_transport_read(LIBSSH2_SESSION * session)
|
||||
int _libssh2_transport_read(LIBSSH2_SESSION * session)
|
||||
{
|
||||
libssh2pack_t rc = -1;
|
||||
int rc = LIBSSH2_ERROR_SOCKET_NONE;
|
||||
struct transportpacket *p = &session->packet;
|
||||
int remainbuf;
|
||||
int remainpack;
|
||||
@ -271,7 +270,6 @@ _libssh2_transport_read(LIBSSH2_SESSION * session)
|
||||
unsigned char block[MAX_BLOCKSIZE];
|
||||
int blocksize;
|
||||
int encrypted = 1;
|
||||
int status;
|
||||
|
||||
/* default clear the bit */
|
||||
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"
|
||||
" key re-exchange");
|
||||
status = libssh2_kex_exchange(session, 1, &session->startup_key_state);
|
||||
if (status == PACKET_EAGAIN)
|
||||
return PACKET_EAGAIN;
|
||||
else if (status)
|
||||
return LIBSSH2_ERROR_KEX_FAILURE;
|
||||
rc = libssh2_kex_exchange(session, 1, &session->startup_key_state);
|
||||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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
|
||||
* "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 */
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user