From afa10d5a895bde397b284103d34dca65c91631aa Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 11 Aug 2014 09:11:57 +0800 Subject: [PATCH] fix spinning on NULL protocol name Signed-off-by: Andy Green --- lib/server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/server.c b/lib/server.c index aad5286..21ccd16 100644 --- a/lib/server.c +++ b/lib/server.c @@ -389,8 +389,10 @@ int lws_handshake_server(struct libwebsocket_context *context, n = 0; while (context->protocols[n].callback) { - if (!wsi->protocol->name) + if (!wsi->protocol->name) { + n++; continue; + } if (!strcmp(context->protocols[n].name, protocol_name)) { lwsl_info("prot match %d\n", n); -- 2.7.4