From e92947680ac64c61dd0276aeca24bab5c6f91143 Mon Sep 17 00:00:00 2001 From: Fujii Bunichiroh Date: Wed, 18 Sep 2013 21:01:02 +0800 Subject: [PATCH] force failed header parse to act ''...Websocket servers return failure responses other than HTTP Status 101 in the case of mismatches of WebSocket version or additional header data etc... It seems that libwebsockets shows "WARN: problems parsing header" error in such cases without calling any callbacks or returning error code. Is this right? I modified lib/client.c to handle this.'' Signed-off-by: Fujii Bunichiroh --- lib/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.c b/lib/client.c index 94a66947..96ae2bd3 100644 --- a/lib/client.c +++ b/lib/client.c @@ -333,7 +333,7 @@ bail3: "closing connection at LWS_CONNMODE...SERVER_REPLY\n"); libwebsocket_close_and_free_session(context, wsi, LWS_CLOSE_STATUS_NOSTATUS); - return 0; + return -1; case LWS_CONNMODE_WS_CLIENT_WAITING_EXTENSION_CONNECT: lwsl_ext("LWS_CONNMODE_WS_CLIENT_WAITING_EXTENSION_CONNECT\n");