diff --git a/lib/client-parser.c b/lib/client-parser.c index b6b592b3..23c8f077 100644 --- a/lib/client-parser.c +++ b/lib/client-parser.c @@ -1,7 +1,7 @@ /* * libwebsockets - small server side websockets and web server implementation * - * Copyright (C) 2010-2013 Andy Green + * Copyright (C) 2010-2014 Andy Green * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -382,7 +382,8 @@ spill: } } #endif - if (eff_buf.token_len <= 0 && callback_action != LWS_CALLBACK_CLIENT_RECEIVE_PONG) + if (eff_buf.token_len <= 0 && + callback_action != LWS_CALLBACK_CLIENT_RECEIVE_PONG) goto already_done; eff_buf.token[eff_buf.token_len] = '\0'; @@ -393,7 +394,7 @@ spill: if (callback_action == LWS_CALLBACK_CLIENT_RECEIVE_PONG) lwsl_info("Client doing pong callback\n"); - wsi->protocol->callback( + m = wsi->protocol->callback( wsi->protocol->owning_server, wsi, (enum libwebsocket_callback_reasons)callback_action, @@ -401,6 +402,10 @@ spill: eff_buf.token, eff_buf.token_len); + /* if user code wants to close, let caller know */ + if (m) + return 1; + already_done: wsi->u.ws.rx_user_buffer_head = 0; break; diff --git a/lib/extension-deflate-frame.c b/lib/extension-deflate-frame.c index b206476b..6cf6ac01 100644 --- a/lib/extension-deflate-frame.c +++ b/lib/extension-deflate-frame.c @@ -163,7 +163,7 @@ bail: * we will get a destroy callback to take care * of closing nicely */ - lwsl_err("zlib error inflate %d: %s\n", + lwsl_info("zlib error inflate %d: %s\n", n, conn->zs_in.msg); return -1; } diff --git a/lib/handshake.c b/lib/handshake.c index c7989c55..7611a6ad 100644 --- a/lib/handshake.c +++ b/lib/handshake.c @@ -146,7 +146,7 @@ http_postbody: case LWS_CONNMODE_WS_CLIENT: for (n = 0; n < len; n++) if (libwebsocket_client_rx_sm(wsi, *buf++)) { - lwsl_info("client_rx_sm failed\n"); + lwsl_debug("client_rx_sm failed\n"); goto bail; } return 0; @@ -417,7 +417,7 @@ cleanup: for (n = 0; n < len; n++) if (libwebsocket_client_rx_sm( wsi, *buf++) < 0) { - lwsl_info("client rx has bailed\n"); + lwsl_debug("client rx has bailed\n"); goto bail; } @@ -450,7 +450,7 @@ bail_nuke_ah: #endif bail: - lwsl_info("closing connection at libwebsocket_read bail:\n"); + lwsl_debug("closing connection at libwebsocket_read bail:\n"); libwebsocket_close_and_free_session(context, wsi, LWS_CLOSE_STATUS_NOSTATUS);