Simple WebSocket server library.
Dependents: WebSocketServerTest
Revision 1:db4114d55f83, committed 2015-03-25
- Comitter:
- flatbird
- Date:
- Wed Mar 25 00:08:17 2015 +0000
- Parent:
- 0:a816c25e83ed
- Child:
- 2:db41b4e0d64b
- Commit message:
- use strncasecmp to compare header. IE uses "Upgrade: Websocket".
Changed in this revision
WebSocketConnection.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/WebSocketConnection.cpp Mon Mar 16 10:13:30 2015 +0000 +++ b/WebSocketConnection.cpp Wed Mar 25 00:08:17 2015 +0000 @@ -80,9 +80,9 @@ printf("ERROR: Handler not found for %s\r\n", path); return false; } - } else if (strncmp(line, UPGRADE_WEBSOCKET, strlen(UPGRADE_WEBSOCKET)) == 0) { + } else if (strncasecmp(line, UPGRADE_WEBSOCKET, strlen(UPGRADE_WEBSOCKET)) == 0) { isUpgradeWebSocket = true; - } else if (strncmp(line, SEC_WEBSOCKET_KEY, strlen(SEC_WEBSOCKET_KEY)) == 0) { + } else if (strncasecmp(line, SEC_WEBSOCKET_KEY, strlen(SEC_WEBSOCKET_KEY)) == 0) { isSecWebSocketKeyFound = true; char* ptr = line + strlen(SEC_WEBSOCKET_KEY); while (*ptr == ' ') ++ptr;