mirror of
https://github.com/nmap/nmap.git
synced 2025-12-14 03:39:02 +00:00
Upgrade libssh2 to 1.11.0
This commit is contained in:
@@ -41,27 +41,26 @@
|
||||
|
||||
/* Conveniance-macros to allow code like this;
|
||||
|
||||
int rc = BLOCK_ADJUST(rc, session, session_startup(session, sock) );
|
||||
int rc = BLOCK_ADJUST(rc, session, session_startup(session, sock));
|
||||
|
||||
int rc = BLOCK_ADJUST_ERRNO(ptr, session, session_startup(session, sock) );
|
||||
int rc = BLOCK_ADJUST_ERRNO(ptr, session, session_startup(session, sock));
|
||||
|
||||
The point of course being to make sure that while in non-blocking mode
|
||||
these always return no matter what the return code is, but in blocking mode
|
||||
it blocks if EAGAIN is the reason for the return from the underlying
|
||||
function.
|
||||
The point being to make sure that while in non-blocking mode these always
|
||||
return no matter what the return code is, but in blocking mode it blocks
|
||||
if EAGAIN is the reason for the return from the underlying function.
|
||||
|
||||
*/
|
||||
#define BLOCK_ADJUST(rc, sess, x) \
|
||||
do { \
|
||||
time_t entry_time = time(NULL); \
|
||||
do { \
|
||||
rc = x; \
|
||||
/* the order of the check below is important to properly deal with \
|
||||
the case when the 'sess' is freed */ \
|
||||
if((rc != LIBSSH2_ERROR_EAGAIN) || !sess->api_block_mode) \
|
||||
break; \
|
||||
rc = _libssh2_wait_socket(sess, entry_time); \
|
||||
} while(!rc); \
|
||||
time_t entry_time = time(NULL); \
|
||||
do { \
|
||||
rc = x; \
|
||||
/* the order of the check below is important to properly \
|
||||
deal with the case when the 'sess' is freed */ \
|
||||
if((rc != LIBSSH2_ERROR_EAGAIN) || !sess->api_block_mode) \
|
||||
break; \
|
||||
rc = _libssh2_wait_socket(sess, entry_time); \
|
||||
} while(!rc); \
|
||||
} while(0)
|
||||
|
||||
/*
|
||||
@@ -72,15 +71,15 @@
|
||||
*/
|
||||
#define BLOCK_ADJUST_ERRNO(ptr, sess, x) \
|
||||
do { \
|
||||
time_t entry_time = time(NULL); \
|
||||
int rc; \
|
||||
do { \
|
||||
ptr = x; \
|
||||
if(!sess->api_block_mode || \
|
||||
(ptr != NULL) || \
|
||||
(libssh2_session_last_errno(sess) != LIBSSH2_ERROR_EAGAIN) ) \
|
||||
break; \
|
||||
rc = _libssh2_wait_socket(sess, entry_time); \
|
||||
time_t entry_time = time(NULL); \
|
||||
int rc; \
|
||||
do { \
|
||||
ptr = x; \
|
||||
if(!sess->api_block_mode || \
|
||||
(ptr != NULL) || \
|
||||
(libssh2_session_last_errno(sess) != LIBSSH2_ERROR_EAGAIN)) \
|
||||
break; \
|
||||
rc = _libssh2_wait_socket(sess, entry_time); \
|
||||
} while(!rc); \
|
||||
} while(0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user