summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2022-10-05 16:36:58 +0200
committerxengineering <me@xengineering.eu>2022-10-05 16:36:58 +0200
commitdba9f6e63eb01d889c551e3f59960d2b349fefd9 (patch)
tree9bfb7a07262e78683e1608d8aa809d820fb0637d
parent5489a2b6a4da7e119d1c3723664c43eceb1bdc35 (diff)
downloadlimox-dba9f6e63eb01d889c551e3f59960d2b349fefd9.tar
limox-dba9f6e63eb01d889c551e3f59960d2b349fefd9.tar.zst
limox-dba9f6e63eb01d889c551e3f59960d2b349fefd9.zip
Add debug output for connection errors
-rw-r--r--net.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net.c b/net.c
index 970ede8..e5d8285 100644
--- a/net.c
+++ b/net.c
@@ -71,10 +71,18 @@ static int roster_handler(xmpp_conn_t *conn, xmpp_stanza_t *stanza,
return 1;
}
-static void conn_handler(xmpp_conn_t *conn, xmpp_conn_event_t status,int error,
- xmpp_stream_error_t *stream_error, void *userdata) {
+static void conn_handler(xmpp_conn_t* conn, xmpp_conn_event_t status,int error,
+ xmpp_stream_error_t* stream_error, void* userdata) {
// FIXME handle error and stream_error (this could be a major bug)
+ // this implements at least debugging:
+ if (error != 0) {
+ fprintf(stderr, "conn_handler got error=%d\n", error);
+ }
+ if (stream_error != NULL) {
+ fprintf(stderr, "conn_handler got stream_error of type %d\n",
+ stream_error->type);
+ }
switch (status) {