1
This commit is contained in:
parent
a87779569d
commit
0c3e904eec
@ -113,12 +113,10 @@ namespace a8
|
||||
return;
|
||||
}
|
||||
std::string server_key;
|
||||
const char* key = WEB_SOCKET_KEY;
|
||||
{
|
||||
char* p1 = strstr(buf + offset, WEB_SOCKET_KEY);
|
||||
if (!p1) {
|
||||
p1 = strstr(buf + offset, WEB_SOCKET_KEY2);
|
||||
key = WEB_SOCKET_KEY2;
|
||||
}
|
||||
if (p1) {
|
||||
p1 += strlen(WEB_SOCKET_KEY);
|
||||
@ -136,7 +134,7 @@ namespace a8
|
||||
std::string response = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
|
||||
"Upgrade: websocket\r\n"
|
||||
"Connection: Upgrade\r\n"
|
||||
+ std::string(key) + hash_data + "\r\n" +
|
||||
"Sec-WebSocket-Accept: " + hash_data + "\r\n" +
|
||||
"\r\n";
|
||||
SendBuff(response.data(), response.size());
|
||||
handshook_ = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user