reduce debug spew
authorDavid Brooks <dave@bcs.co.nz>
Fri, 20 Apr 2012 04:13:37 +0000 (12:13 +0800)
committerAndy Green <andy.green@linaro.org>
Fri, 20 Apr 2012 04:13:37 +0000 (12:13 +0800)
Signed-off-by: David Brooks <dave@bcs.co.nz>
Signed-off-by: Andy Green <andy@warmcat.com>
--

lib/libwebsockets.c
lib/parsers.c

index 9e22a16..13a18c6 100644 (file)
@@ -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++;
index 61f3045..a185971 100644 (file)
@@ -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;