1
0
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:
Daniel Stenberg
2010-10-21 10:39:06 +02:00
parent 64063d5f0b
commit 3a391f6cf2
4 changed files with 41 additions and 18 deletions

View File

@@ -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