fix proto regression from last commit

This commit is contained in:
Anthony Minessale 2013-09-19 19:34:58 -04:00
parent c1e19690d1
commit 8493c88f88
2 changed files with 4 additions and 3 deletions

View File

@ -1 +1 @@
Thu Sep 19 13:44:16 CDT 2013
Thu Sep 19 19:34:50 EDT 2013

View File

@ -223,6 +223,7 @@ int ws_handshake(wsh_t *wsh)
char key[256] = "";
char version[5] = "";
char proto[256] = "";
char proto_buf[384] = "";
char uri[256] = "";
char input[256] = "";
unsigned char output[SHA1_HASH_SIZE] = "";
@ -274,7 +275,7 @@ int ws_handshake(wsh_t *wsh)
b64encode((unsigned char *)output, SHA1_HASH_SIZE, (unsigned char *)b64, sizeof(b64));
if (*proto) {
snprintf(proto, sizeof(proto), "Sec-WebSocket-Protocol: %s\r\n", proto);
snprintf(proto_buf, sizeof(proto_buf), "Sec-WebSocket-Protocol: %s\r\n", proto);
}
snprintf(respond, sizeof(respond),
@ -284,7 +285,7 @@ int ws_handshake(wsh_t *wsh)
"Sec-WebSocket-Accept: %s\r\n"
"%s\r\n",
b64,
proto);
proto_buf);
ws_raw_write(wsh, respond, strlen(respond));