From 670d96dc3e2abaee900666cd0cb255084ad5fdcd Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 10 May 2017 04:49:12 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5101 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/net_wins.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/common/net_wins.c b/engine/common/net_wins.c index 912349547..f779112a8 100644 --- a/engine/common/net_wins.c +++ b/engine/common/net_wins.c @@ -3871,6 +3871,7 @@ qboolean FTENET_TCP_ParseHTTPRequest(ftenet_tcpconnect_connection_t *con, ftenet } else { + qboolean fail = false; char acceptkey[20*2]; unsigned char sha1digest[20]; char *blurgh; @@ -3910,12 +3911,12 @@ qboolean FTENET_TCP_ParseHTTPRequest(ftenet_tcpconnect_connection_t *con, ftenet case TCPC_WEBSOCKETU: case TCPC_WEBSOCKETB: if (!net_enable_websockets.ival) - return false; + fail = true; break; case TCPC_WEBRTC_HOST: case TCPC_WEBRTC_CLIENT: if (!net_enable_webrtcbroker.ival) - return false; + fail = true; break; default: return false; @@ -3931,6 +3932,9 @@ qboolean FTENET_TCP_ParseHTTPRequest(ftenet_tcpconnect_connection_t *con, ftenet fail = true; #endif + if (fail) + return false; + resp = va( "HTTP/1.1 101 WebSocket Protocol Handshake\r\n" "Upgrade: websocket\r\n" "Connection: Upgrade\r\n"