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

confirm upgrade actually for websocket

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2014-09-30 08:15:49 +08:00
parent 104316eb8f
commit 2af585660d

View file

@ -354,6 +354,16 @@ int lws_handshake_server(struct libwebsocket_context *context,
return 0; /* don't bail out of libwebsocket_read, just yet */
}
if (!strcasecmp(lws_hdr_simple_ptr(wsi, WSI_TOKEN_UPGRADE),
"websocket"))
goto upgrade_ws;
/* dunno what he wanted to upgrade to */
goto bail_nuke_ah;
upgrade_ws:
if (!wsi->protocol)
lwsl_err("NULL protocol at libwebsocket_read\n");