mirror of
https://github.com/libssh2/libssh2.git
synced 2025-08-07 08:02:56 +03:00
- Vlad Grachov brought the new function called
libssh2_session_block_directions() which returns a bitmask for what directions the connection blocks. It is to be used applications that use non-blocking sockets and when a libssh2 function returns LIBSSH2_ERROR_EAGAIN this function can be used to figure out in which direction the socket would block and thus it can wait for the socket to again be ready for communication in that direction before it calls libssh2 again.
This commit is contained in:
@@ -244,6 +244,11 @@ typedef struct _LIBSSH2_POLLFD {
|
||||
#define LIBSSH2_POLLFD_CHANNEL_CLOSED 0x0080 /* Channel Disconnect */
|
||||
#define LIBSSH2_POLLFD_LISTENER_CLOSED 0x0080 /* Listener Disconnect */
|
||||
|
||||
#define HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION
|
||||
/* Block Direction Types */
|
||||
#define LIBSSH2_SESSION_BLOCK_INBOUND 0x0001
|
||||
#define LIBSSH2_SESSION_BLOCK_OUTBOUND 0x0002
|
||||
|
||||
/* Hash Types */
|
||||
#define LIBSSH2_HOSTKEY_HASH_MD5 1
|
||||
#define LIBSSH2_HOSTKEY_HASH_SHA1 2
|
||||
@@ -324,6 +329,7 @@ LIBSSH2_API int libssh2_session_method_pref(LIBSSH2_SESSION *session, int method
|
||||
LIBSSH2_API const char *libssh2_session_methods(LIBSSH2_SESSION *session, int method_type);
|
||||
LIBSSH2_API int libssh2_session_last_error(LIBSSH2_SESSION *session, char **errmsg, int *errmsg_len, int want_buf);
|
||||
LIBSSH2_API int libssh2_session_last_errno(LIBSSH2_SESSION *session);
|
||||
LIBSSH2_API int libssh2_session_block_directions(LIBSSH2_SESSION *session);
|
||||
|
||||
LIBSSH2_API int libssh2_session_flag(LIBSSH2_SESSION *session, int flag, int value);
|
||||
|
||||
|
Reference in New Issue
Block a user