1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-02-02 15:08:15 -05:00

Made connection free resources static function

This commit is contained in:
James Booth 2013-02-27 20:46:44 +00:00
parent d0e0951943
commit 8d1cc96bf2
2 changed files with 6 additions and 5 deletions

View File

@ -85,6 +85,8 @@ static void _connection_handler(xmpp_conn_t * const conn,
xmpp_stream_error_t * const stream_error, void * const userdata); xmpp_stream_error_t * const stream_error, void * const userdata);
static int _ping_timed_handler(xmpp_conn_t * const conn, void * const userdata); static int _ping_timed_handler(xmpp_conn_t * const conn, void * const userdata);
void _connection_free_resources(void);
void void
jabber_init(const int disable_tls) jabber_init(const int disable_tls)
{ {
@ -163,7 +165,7 @@ jabber_disconnect(void)
while (jabber_get_connection_status() == JABBER_DISCONNECTING) { while (jabber_get_connection_status() == JABBER_DISCONNECTING) {
jabber_process_events(); jabber_process_events();
} }
connection_free_resources(); _connection_free_resources();
} }
jabber_conn.conn_status = JABBER_STARTED; jabber_conn.conn_status = JABBER_STARTED;
@ -275,7 +277,7 @@ connection_remove_available_resource(const char * const resource)
} }
void void
connection_free_resources(void) _connection_free_resources(void)
{ {
FREE_SET_NULL(saved_details.name); FREE_SET_NULL(saved_details.name);
FREE_SET_NULL(saved_details.jid); FREE_SET_NULL(saved_details.jid);
@ -456,7 +458,7 @@ _connection_handler(xmpp_conn_t * const conn,
reconnect_timer = g_timer_new(); reconnect_timer = g_timer_new();
// TODO: free resources but leave saved_user untouched // TODO: free resources but leave saved_user untouched
} else { } else {
connection_free_resources(); _connection_free_resources();
} }
// login attempt failed // login attempt failed
@ -465,7 +467,7 @@ _connection_handler(xmpp_conn_t * const conn,
if (reconnect_timer == NULL) { if (reconnect_timer == NULL) {
log_debug("Connection handler: No reconnect timer"); log_debug("Connection handler: No reconnect timer");
prof_handle_failed_login(); prof_handle_failed_login();
connection_free_resources(); _connection_free_resources();
} else { } else {
log_debug("Connection handler: Restarting reconnect timer"); log_debug("Connection handler: Restarting reconnect timer");
if (prefs_get_reconnect() != 0) { if (prefs_get_reconnect() != 0) {

View File

@ -25,7 +25,6 @@
#include <strophe.h> #include <strophe.h>
void connection_free_resources(void);
xmpp_conn_t *connection_get_conn(void); xmpp_conn_t *connection_get_conn(void);
xmpp_ctx_t *connection_get_ctx(void); xmpp_ctx_t *connection_get_ctx(void);
int connection_error_handler(xmpp_conn_t * const conn, int connection_error_handler(xmpp_conn_t * const conn,