mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-02 10:53:16 +03:00
compress: faster check, better return codes
In the transport functions we avoid a strcmp() now and just check a boolean instead. The compress/decompress function's return code is now acknowledged and used as actual return code in case of failures.
This commit is contained in:
@@ -77,6 +77,7 @@ comp_method_none_comp(LIBSSH2_SESSION * session,
|
||||
|
||||
static const LIBSSH2_COMP_METHOD comp_method_none = {
|
||||
"none",
|
||||
0, /* not really compressing */
|
||||
NULL,
|
||||
comp_method_none_comp,
|
||||
NULL
|
||||
@@ -318,6 +319,7 @@ comp_method_zlib_dtor(LIBSSH2_SESSION * session, int compress,
|
||||
|
||||
static const LIBSSH2_COMP_METHOD comp_method_zlib = {
|
||||
"zlib",
|
||||
1, /* yes, this compresses */
|
||||
comp_method_zlib_init,
|
||||
comp_method_zlib_comp,
|
||||
comp_method_zlib_dtor,
|
||||
|
||||
Reference in New Issue
Block a user