diff --git a/src/conn.c b/src/conn.c index a7e378e..66c1cb1 100644 --- a/src/conn.c +++ b/src/conn.c @@ -799,7 +799,8 @@ int xmpp_connect_component(xmpp_conn_t *conn, return XMPP_EINVOP; /* XEP-0114 does not support TLS */ - xmpp_conn_disable_tls(conn); + (void)xmpp_conn_set_flags(conn, xmpp_conn_get_flags(conn) | + XMPP_CONN_FLAG_DISABLE_TLS); if (!conn->tls_disabled) { strophe_error(conn->ctx, "conn", "Failed to disable TLS. " @@ -1203,25 +1204,6 @@ int xmpp_conn_set_flags(xmpp_conn_t *conn, long flags) return 0; } -/** Disable TLS for this connection, called by users of the library. - * Occasionally a server will be misconfigured to send the starttls - * feature, but will not support the handshake. - * - * @param conn a Strophe connection object - * - * @note this function is deprecated - * @see xmpp_conn_set_flags() - * - * @ingroup Connections - */ -void xmpp_conn_disable_tls(xmpp_conn_t *conn) -{ - long flags = xmpp_conn_get_flags(conn); - - flags |= XMPP_CONN_FLAG_DISABLE_TLS; - (void)xmpp_conn_set_flags(conn, flags); -} - /** Return whether TLS session is established or not. * * @return TRUE if TLS session is established and FALSE otherwise diff --git a/src/deprecated.c b/src/deprecated.c index 8ec61ed..76018a9 100644 --- a/src/deprecated.c +++ b/src/deprecated.c @@ -255,3 +255,22 @@ void xmpp_conn_set_keepalive(xmpp_conn_t *conn, int timeout, int interval) conn->ka_count = 0; xmpp_conn_set_sockopt_callback(conn, xmpp_sockopt_cb_keepalive); } + +/** Disable TLS for this connection, called by users of the library. + * Occasionally a server will be misconfigured to send the starttls + * feature, but will not support the handshake. + * + * @param conn a Strophe connection object + * + * @note this function is deprecated + * @see xmpp_conn_set_flags() + * + * @ingroup Deprecated + */ +void xmpp_conn_disable_tls(xmpp_conn_t *conn) +{ + long flags = xmpp_conn_get_flags(conn); + + flags |= XMPP_CONN_FLAG_DISABLE_TLS; + (void)xmpp_conn_set_flags(conn, flags); +} diff --git a/strophe.h b/strophe.h index b747252..8f347bb 100644 --- a/strophe.h +++ b/strophe.h @@ -382,7 +382,6 @@ char *xmpp_conn_cert_xmppaddr(xmpp_conn_t *conn, unsigned int n); const char *xmpp_conn_get_pass(const xmpp_conn_t *conn); void xmpp_conn_set_pass(xmpp_conn_t *conn, const char *pass); xmpp_ctx_t *xmpp_conn_get_context(xmpp_conn_t *conn); -void xmpp_conn_disable_tls(xmpp_conn_t *conn); int xmpp_conn_is_secured(xmpp_conn_t *conn); void xmpp_conn_set_sockopt_callback(xmpp_conn_t *conn, xmpp_sockopt_callback callback); @@ -743,6 +742,8 @@ void xmpp_debug_verbose( XMPP_DEPRECATED(xmpp_conn_set_sockopt_callback) void xmpp_conn_set_keepalive(xmpp_conn_t *conn, int timeout, int interval); +XMPP_DEPRECATED(xmpp_conn_set_flags) +void xmpp_conn_disable_tls(xmpp_conn_t *conn); #ifdef __cplusplus }