diff options
author | xengineering <me@xengineering.eu> | 2022-10-05 16:36:58 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2022-10-05 16:36:58 +0200 |
commit | dba9f6e63eb01d889c551e3f59960d2b349fefd9 (patch) | |
tree | 9bfb7a07262e78683e1608d8aa809d820fb0637d | |
parent | 5489a2b6a4da7e119d1c3723664c43eceb1bdc35 (diff) | |
download | limox-dba9f6e63eb01d889c551e3f59960d2b349fefd9.tar limox-dba9f6e63eb01d889c551e3f59960d2b349fefd9.tar.zst limox-dba9f6e63eb01d889c551e3f59960d2b349fefd9.zip |
Add debug output for connection errors
-rw-r--r-- | net.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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) { |