From 8d1cc96bf25bb9bc6a199c1571b0d53d4f248b8f Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 27 Feb 2013 20:46:44 +0000 Subject: [PATCH] Made connection free resources static function --- src/xmpp/connection.c | 10 ++++++---- src/xmpp/connection.h | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index 2c15fe44..d01e33fa 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -85,6 +85,8 @@ static void _connection_handler(xmpp_conn_t * const conn, xmpp_stream_error_t * const stream_error, void * const userdata); static int _ping_timed_handler(xmpp_conn_t * const conn, void * const userdata); +void _connection_free_resources(void); + void jabber_init(const int disable_tls) { @@ -163,7 +165,7 @@ jabber_disconnect(void) while (jabber_get_connection_status() == JABBER_DISCONNECTING) { jabber_process_events(); } - connection_free_resources(); + _connection_free_resources(); } jabber_conn.conn_status = JABBER_STARTED; @@ -275,7 +277,7 @@ connection_remove_available_resource(const char * const resource) } void -connection_free_resources(void) +_connection_free_resources(void) { FREE_SET_NULL(saved_details.name); FREE_SET_NULL(saved_details.jid); @@ -456,7 +458,7 @@ _connection_handler(xmpp_conn_t * const conn, reconnect_timer = g_timer_new(); // TODO: free resources but leave saved_user untouched } else { - connection_free_resources(); + _connection_free_resources(); } // login attempt failed @@ -465,7 +467,7 @@ _connection_handler(xmpp_conn_t * const conn, if (reconnect_timer == NULL) { log_debug("Connection handler: No reconnect timer"); prof_handle_failed_login(); - connection_free_resources(); + _connection_free_resources(); } else { log_debug("Connection handler: Restarting reconnect timer"); if (prefs_get_reconnect() != 0) { diff --git a/src/xmpp/connection.h b/src/xmpp/connection.h index c242f65f..3c0c1bff 100644 --- a/src/xmpp/connection.h +++ b/src/xmpp/connection.h @@ -25,7 +25,6 @@ #include -void connection_free_resources(void); xmpp_conn_t *connection_get_conn(void); xmpp_ctx_t *connection_get_ctx(void); int connection_error_handler(xmpp_conn_t * const conn,