@@ -170,6 +170,8 @@ xmpp_conn_t *xmpp_conn_new(xmpp_ctx_t *ctx)
170170 tls_clear_password_cache (conn );
171171 conn -> password_retries = 1 ;
172172
173+ conn -> compression .level = -1 ;
174+
173175 conn -> parser =
174176 parser_new (conn -> ctx , _handle_stream_start , _handle_stream_end ,
175177 _handle_stream_stanza , conn );
@@ -351,6 +353,10 @@ int xmpp_conn_release(xmpp_conn_t *conn)
351353 * In case the user enters the password manually it can be useful to
352354 * directly retry if the decryption of the key file failed.
353355 *
356+ * - \ref XMPP_SETTING_COMPRESSION_LEVEL
357+ * Set the compression level. \n
358+ * For zlib the valid range is `-1` to `9`.
359+ *
354360 * @param conn a Strophe connection object
355361 * @param setting The setting that shall be configured
356362 * @param value The value, the settings should get
@@ -368,6 +374,9 @@ void xmpp_conn_set_int(xmpp_conn_t *conn,
368374 else
369375 conn -> password_retries = value ;
370376 break ;
377+ case XMPP_SETTING_COMPRESSION_LEVEL :
378+ conn -> compression .level = value ;
379+ break ;
371380 default :
372381 strophe_warn (conn -> ctx , "xmpp" , "Invalid Int setting %d" , setting );
373382 return ;
0 commit comments