1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-23 01:22:37 +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

@@ -1227,19 +1227,24 @@ libssh2_session_last_errno(LIBSSH2_SESSION * session)
*
* Set/Get session flags
*
* Passing flag==0 will avoid changing session->flags while still returning
* its current value
* Return error code.
*/
LIBSSH2_API int
libssh2_session_flag(LIBSSH2_SESSION * session, int flag, int value)
{
if (value) {
session->flags |= flag;
} else {
session->flags &= ~flag;
switch(flag) {
case LIBSSH2_FLAG_SIGPIPE:
session->flag.sigpipe = value;
break;
case LIBSSH2_FLAG_COMPRESS:
session->flag.compress = value;
break;
default:
/* unknown flag */
return LIBSSH2_ERROR_INVAL;
}
return session->flags;
return LIBSSH2_ERROR_NONE;
}
/* _libssh2_session_set_blocking