summaryrefslogtreecommitdiff
path: root/net_legacy.c
diff options
context:
space:
mode:
Diffstat (limited to 'net_legacy.c')
-rw-r--r--net_legacy.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net_legacy.c b/net_legacy.c
index 3e8b4cf..c3b2f62 100644
--- a/net_legacy.c
+++ b/net_legacy.c
@@ -42,7 +42,7 @@ static int message_handler(xmpp_conn_t* conn, xmpp_stanza_t* stanza,
xmpp_stanza_t* body = xmpp_stanza_get_child_by_name(stanza, "body");
if (body == NULL) {
- printf("DEBUG: Got message stanza of type char without body!\n");
+ fprintf(stderr, "DEBUG: Got message stanza of type char without body!\n");
return 1;
}
@@ -78,7 +78,7 @@ static void conn_handler(xmpp_conn_t *conn, xmpp_conn_event_t status,int error,
switch (status) {
case XMPP_CONN_CONNECT:
- printf("DEBUG: Got XMPP_CONN_CONNECT\n");
+ fprintf(stderr, "DEBUG: Got XMPP_CONN_CONNECT\n");
// add handler for <message> stanzas
xmpp_handler_add(conn, message_handler, NULL, "message", "chat",
@@ -107,26 +107,26 @@ static void conn_handler(xmpp_conn_t *conn, xmpp_conn_event_t status,int error,
break;
case XMPP_CONN_RAW_CONNECT:
- printf("DEBUG: Got XMPP_CONN_RAW_CONNECT\n");
+ fprintf(stderr, "DEBUG: Got XMPP_CONN_RAW_CONNECT\n");
break;
case XMPP_CONN_DISCONNECT:
- printf("DEBUG: Got XMPP_CONN_DISCONNECT\n");
+ fprintf(stderr, "DEBUG: Got XMPP_CONN_DISCONNECT\n");
break;
case XMPP_CONN_FAIL:
- printf("DEBUG: Got XMPP_CONN_FAIL\n");
+ fprintf(stderr, "DEBUG: Got XMPP_CONN_FAIL\n");
break;
default:
- printf("DEBUG: Got unknown connection status '%d'!\n", status);
+ fprintf(stderr, "DEBUG: Got unknown connection status '%d'!\n", status);
exit(1);
}
}
void net_init(void) {
- printf("net_init()\n");
+ fprintf(stderr, "net_init()\n");
xmpp_initialize();
log = xmpp_get_default_logger(XMPP_LEVEL_DEBUG); // or NULL for silence
@@ -166,7 +166,7 @@ void net_run_once(void) {
void net_quit(void) {
- printf("net_quit()\n");
+ fprintf(stderr, "net_quit()\n");
net_disconnect();
// TODO is it possible to free xmpp_log_t ?
@@ -178,7 +178,7 @@ void net_quit(void) {
void net_connect(const char* jid, const char* password) {
- printf("net_connect()\n");
+ fprintf(stderr, "net_connect()\n");
conn = xmpp_conn_new(ctx);
@@ -195,7 +195,7 @@ void net_connect(const char* jid, const char* password) {
void net_disconnect(void) {
- printf("net_disconnect()\n");
+ fprintf(stderr, "net_disconnect()\n");
if (sm_state) {
xmpp_free_sm_state(sm_state);
@@ -209,7 +209,7 @@ void net_disconnect(void) {
// state "disconnecting"
}
if (!xmpp_conn_release(conn)) {
- printf("DEBUG: Could not free connection!\n");
+ fprintf(stderr, "DEBUG: Could not free connection!\n");
}
}