summaryrefslogtreecommitdiff
path: root/limox.c
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2022-08-16 08:11:38 +0200
committerxengineering <me@xengineering.eu>2022-08-16 08:11:38 +0200
commit8fca7d6ea2d7e191d8b4201e3490bfd001813461 (patch)
tree99a03cc4b34558ae6cf88053b6f3fbc20eb22840 /limox.c
parent21a2b2033485c106a537e5e2302f4e4d96a66b94 (diff)
downloadlimox-8fca7d6ea2d7e191d8b4201e3490bfd001813461.tar
limox-8fca7d6ea2d7e191d8b4201e3490bfd001813461.tar.zst
limox-8fca7d6ea2d7e191d8b4201e3490bfd001813461.zip
Handle every xmpp_conn_event_t with debug message
Diffstat (limited to 'limox.c')
-rw-r--r--limox.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/limox.c b/limox.c
index 618c2ef..b0e74dd 100644
--- a/limox.c
+++ b/limox.c
@@ -37,18 +37,34 @@ static xmpp_sm_state_t* sm_state;
static void conn_handler(xmpp_conn_t *conn, xmpp_conn_event_t status,int error,
xmpp_stream_error_t *stream_error, void *userdata) {
- if (status == XMPP_CONN_CONNECT) {
- printf("DEBUG: connected\n");
-
- // send initial presence
- xmpp_stanza_t* presence;
- presence = xmpp_presence_new(ctx);
- xmpp_send(conn, presence);
- xmpp_stanza_release(presence);
- } else if (status == XMPP_CONN_DISCONNECT) {
- printf("got XMPP_CONN_DISCONNECT\n");
- } else {
- printf("Unhandled connection event!\n");
+ switch (status) {
+
+ case XMPP_CONN_CONNECT:
+ printf("DEBUG: Got XMPP_CONN_CONNECT\n");
+
+ // send initial presence
+ xmpp_stanza_t* presence;
+ presence = xmpp_presence_new(ctx);
+ xmpp_send(conn, presence);
+ xmpp_stanza_release(presence);
+
+ break;
+
+ case XMPP_CONN_RAW_CONNECT:
+ printf("DEBUG: Got XMPP_CONN_RAW_CONNECT\n");
+ break;
+
+ case XMPP_CONN_DISCONNECT:
+ printf("DEBUG: Got XMPP_CONN_DISCONNECT\n");
+ break;
+
+ case XMPP_CONN_FAIL:
+ printf("DEBUG: Got XMPP_CONN_FAIL\n");
+ break;
+
+ default:
+ printf("DEBUG: Got unknown connection status '%d'!\n", status);
+ exit(1);
}
}