1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

server allow NULL protocol map to protocol 0

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-01-30 12:26:14 +08:00
parent aaf0b9f514
commit 5fc75a9b6b

View file

@ -149,14 +149,16 @@ libwebsocket_read(struct libwebsocket_context *context,
/* we didn't find a protocol he wanted? */
if (wsi->protocol->callback == NULL) {
if (wsi->utf8_token[WSI_TOKEN_PROTOCOL].token == NULL)
lwsl_err("[no protocol] "
"not supported (use NULL .name)\n");
else
if (wsi->utf8_token[WSI_TOKEN_PROTOCOL].token == NULL) {
lwsl_info("[no protocol] "
"mapped to protocol 0 handler\n");
wsi->protocol = &context->protocols[0];
} else {
lwsl_err("Requested protocol %s "
"not supported\n",
wsi->utf8_token[WSI_TOKEN_PROTOCOL].token);
goto bail;
goto bail;
}
}
/*