mirror of
https://github.com/libssh2/libssh2.git
synced 2025-10-31 23:30:25 +03:00
compress: compression disabled by default
We now allow libssh2_session_flag() to enable compression with a new flag and I added documentation for the previous LIBSSH2_FLAG_SIGPIPE flag which I wasn't really aware of!
This commit is contained in:
@@ -661,6 +661,11 @@ struct _LIBSSH2_SFTP
|
||||
|
||||
#define LIBSSH2_SCP_RESPONSE_BUFLEN 256
|
||||
|
||||
struct flags {
|
||||
int sigpipe; /* LIBSSH2_FLAG_SIGPIPE */
|
||||
int compress; /* LIBSSH2_FLAG_COMPRESS */
|
||||
};
|
||||
|
||||
struct _LIBSSH2_SESSION
|
||||
{
|
||||
/* Memory management callbacks */
|
||||
@@ -681,7 +686,9 @@ struct _LIBSSH2_SESSION
|
||||
char *hostkey_prefs;
|
||||
|
||||
int state;
|
||||
int flags;
|
||||
|
||||
/* Flag options */
|
||||
struct flags flag;
|
||||
|
||||
/* Agreed Key Exchange Method */
|
||||
const LIBSSH2_KEX_METHOD *kex;
|
||||
@@ -930,8 +937,8 @@ struct _LIBSSH2_SESSION
|
||||
|
||||
/* session.flag helpers */
|
||||
#ifdef MSG_NOSIGNAL
|
||||
#define LIBSSH2_SOCKET_SEND_FLAGS(session) (((session)->flags & LIBSSH2_FLAG_SIGPIPE) ? 0 : MSG_NOSIGNAL)
|
||||
#define LIBSSH2_SOCKET_RECV_FLAGS(session) (((session)->flags & LIBSSH2_FLAG_SIGPIPE) ? 0 : MSG_NOSIGNAL)
|
||||
#define LIBSSH2_SOCKET_SEND_FLAGS(session) (((session)->flag.sigpipe) ? 0 : MSG_NOSIGNAL)
|
||||
#define LIBSSH2_SOCKET_RECV_FLAGS(session) (((session)->flag.sigpipe) ? 0 : MSG_NOSIGNAL)
|
||||
#else
|
||||
/* If MSG_NOSIGNAL isn't defined we're SOL on blocking SIGPIPE */
|
||||
#define LIBSSH2_SOCKET_SEND_FLAGS(session) 0
|
||||
|
||||
Reference in New Issue
Block a user