diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 9e22a160..13a18c68 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1392,7 +1392,7 @@ accept_ok: wsi->state = WSI_STATE_ESTABLISHED; wsi->mode = LWS_CONNMODE_WS_CLIENT; - fprintf(stderr, "handshake OK for protocol %s\n", wsi->protocol->name); + debug("handshake OK for protocol %s\n", wsi->protocol->name); /* call him back to inform him he is up */ @@ -2847,8 +2847,7 @@ libwebsocket_create_context(int port, const char *interf, protocols[context->count_protocols].callback; context->count_protocols++) { - fprintf(stderr, " Protocol: %s\n", - protocols[context->count_protocols].name); + debug(" Protocol: %s\n", protocols[context->count_protocols].name); protocols[context->count_protocols].owning_server = context; protocols[context->count_protocols].protocol_index = @@ -2924,7 +2923,7 @@ libwebsocket_create_context(int port, const char *interf, if (port) m = LWS_EXT_CALLBACK_SERVER_CONTEXT_CONSTRUCT; while (extensions->callback) { - fprintf(stderr, " Extension: %s\n", extensions->name); + debug(" Extension: %s\n", extensions->name); extensions->callback(context, extensions, NULL, m, NULL, NULL, 0); extensions++; diff --git a/lib/parsers.c b/lib/parsers.c index 61f30456..a1859716 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -737,7 +737,7 @@ spill: * fine he has told us he is closing too, let's * finish our close */ - fprintf(stderr, "seen client close ack\n"); + debug("seen client close ack\n"); return -1; } debug("server sees client close packet\n"); @@ -1206,14 +1206,12 @@ spill: debug("seen server's close ack\n"); return -1; } - fprintf(stderr, "client sees server close packet " - "len = %d\n", wsi->rx_user_buffer_head); + debug("client sees server close packet len = %d\n", wsi->rx_user_buffer_head); /* parrot the close packet payload back */ n = libwebsocket_write(wsi, (unsigned char *) &wsi->rx_user_buffer[LWS_SEND_BUFFER_PRE_PADDING], wsi->rx_user_buffer_head, LWS_WRITE_CLOSE); - fprintf(stderr, "client writing close " - "ack returned %d\n", n); + debug("client writing close ack returned %d\n", n); wsi->state = WSI_STATE_RETURNED_CLOSE_ALREADY; /* close the connection */ return -1;