@@ -167,6 +167,8 @@ xmpp_conn_t *xmpp_conn_new(xmpp_ctx_t *ctx)
167167 tls_clear_password_cache (conn );
168168 conn -> password_retries = 1 ;
169169
170+ conn -> compression .level = -1 ;
171+
170172 conn -> parser =
171173 parser_new (conn -> ctx , _handle_stream_start , _handle_stream_end ,
172174 _handle_stream_stanza , conn );
@@ -348,6 +350,10 @@ int xmpp_conn_release(xmpp_conn_t *conn)
348350 * In case the user enters the password manually it can be useful to
349351 * directly retry if the decryption of the key file failed.
350352 *
353+ * - \ref XMPP_SETTING_COMPRESSION_LEVEL
354+ * Set the compression level. \n
355+ * For zlib the valid range is `-1` to `9`.
356+ *
351357 * @param conn a Strophe connection object
352358 * @param setting The setting that shall be configured
353359 * @param value The value, the settings should get
@@ -365,6 +371,9 @@ void xmpp_conn_set_int(xmpp_conn_t *conn,
365371 else
366372 conn -> password_retries = value ;
367373 break ;
374+ case XMPP_SETTING_COMPRESSION_LEVEL :
375+ conn -> compression .level = value ;
376+ break ;
368377 default :
369378 strophe_warn (conn -> ctx , "xmpp" , "Invalid Int setting %d" , setting );
370379 return ;
0 commit comments