1
0
Fork 0
forked from fte/fteqw

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5101 fc73d0e0-1445-4013-8a0c-d673dee63da5

This commit is contained in:
Spoike 2017-05-10 04:49:12 +00:00
parent 493d66b832
commit 670d96dc3e

View file

@ -3871,6 +3871,7 @@ qboolean FTENET_TCP_ParseHTTPRequest(ftenet_tcpconnect_connection_t *con, ftenet
} }
else else
{ {
qboolean fail = false;
char acceptkey[20*2]; char acceptkey[20*2];
unsigned char sha1digest[20]; unsigned char sha1digest[20];
char *blurgh; char *blurgh;
@ -3910,12 +3911,12 @@ qboolean FTENET_TCP_ParseHTTPRequest(ftenet_tcpconnect_connection_t *con, ftenet
case TCPC_WEBSOCKETU: case TCPC_WEBSOCKETU:
case TCPC_WEBSOCKETB: case TCPC_WEBSOCKETB:
if (!net_enable_websockets.ival) if (!net_enable_websockets.ival)
return false; fail = true;
break; break;
case TCPC_WEBRTC_HOST: case TCPC_WEBRTC_HOST:
case TCPC_WEBRTC_CLIENT: case TCPC_WEBRTC_CLIENT:
if (!net_enable_webrtcbroker.ival) if (!net_enable_webrtcbroker.ival)
return false; fail = true;
break; break;
default: default:
return false; return false;
@ -3931,6 +3932,9 @@ qboolean FTENET_TCP_ParseHTTPRequest(ftenet_tcpconnect_connection_t *con, ftenet
fail = true; fail = true;
#endif #endif
if (fail)
return false;
resp = va( "HTTP/1.1 101 WebSocket Protocol Handshake\r\n" resp = va( "HTTP/1.1 101 WebSocket Protocol Handshake\r\n"
"Upgrade: websocket\r\n" "Upgrade: websocket\r\n"
"Connection: Upgrade\r\n" "Connection: Upgrade\r\n"