about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-02-26 22:02:03 +0000
committerJames Booth <boothj5@gmail.com>2013-02-26 22:02:03 +0000
commitd0e0951943a14242e4f8426afc57785dee1d6846 (patch)
tree9fe3168c4dff9c50ccb49c3629bc9f54a474e632 /src/xmpp
parent236895ec96eb65059a0546826b0e5a4dde8c5c97 (diff)
downloadprofani-tty-d0e0951943a14242e4f8426afc57785dee1d6846.tar.gz
Added debug to connection handler
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/connection.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c
index bdbf948c..2c15fe44 100644
--- a/src/xmpp/connection.c
+++ b/src/xmpp/connection.c
@@ -400,13 +400,16 @@ _connection_handler(xmpp_conn_t * const conn,
 
     // login success
     if (status == XMPP_CONN_CONNECT) {
+        log_debug("Connection handler: XMPP_CONN_CONNECT");
 
         // logged in with account
         if (saved_account.name != NULL) {
+            log_debug("Connection handler: logged in with account name: %s", saved_account.name);
             prof_handle_login_account_success(saved_account.name);
 
         // logged in without account, use details to create new account
         } else {
+            log_debug("Connection handler: logged in with jid: %s", saved_details.name);
             accounts_add(saved_details.name, saved_details.altdomain);
             accounts_set_jid(saved_details.name, saved_details.jid);
 
@@ -442,9 +445,11 @@ _connection_handler(xmpp_conn_t * const conn,
         }
 
     } else if (status == XMPP_CONN_DISCONNECT) {
+        log_debug("Connection handler: XMPP_CONN_DISCONNECT");
 
         // lost connection for unkown reason
         if (jabber_conn.conn_status == JABBER_CONNECTED) {
+            log_debug("Connection handler: Lost connection for unknown reason");
             prof_handle_lost_connection();
             if (prefs_get_reconnect() != 0) {
                 assert(reconnect_timer == NULL);
@@ -456,10 +461,13 @@ _connection_handler(xmpp_conn_t * const conn,
 
         // login attempt failed
         } else if (jabber_conn.conn_status != JABBER_DISCONNECTING) {
+            log_debug("Connection handler: Login failed");
             if (reconnect_timer == NULL) {
+                log_debug("Connection handler: No reconnect timer");
                 prof_handle_failed_login();
                 connection_free_resources();
             } else {
+                log_debug("Connection handler: Restarting reconnect timer");
                 if (prefs_get_reconnect() != 0) {
                     g_timer_start(reconnect_timer);
                 }
@@ -469,6 +477,10 @@ _connection_handler(xmpp_conn_t * const conn,
 
         // close stream response from server after disconnect is handled too
         jabber_conn.conn_status = JABBER_DISCONNECTED;
+    } else if (status == XMPP_CONN_FAIL) {
+        log_debug("Connection handler: XMPP_CONN_FAIL");
+    } else {
+        log_error("Connection handler: Unknown status");
     }
 }