bug 675919 - websockets fail connection on unknown control code. r=jduell

This commit is contained in:
Patrick McManus
2011-08-04 22:45:55 -07:00
parent 5cf8dd8e1d
commit 5cf27f6172

View File

@@ -916,10 +916,15 @@ WebSocketChannel::ProcessInput(PRUint8 *buffer, PRUint32 count)
} else if (opcode == kPing) { } else if (opcode == kPing) {
LOG(("WebSocketChannel:: ping received\n")); LOG(("WebSocketChannel:: ping received\n"));
GeneratePong(payload, payloadLength); GeneratePong(payload, payloadLength);
} else { } else if (opcode == kPong) {
// opcode kPong: the mere act of receiving the packet is all we need // opcode kPong: the mere act of receiving the packet is all we need
// to do for the pong to trigger the activity timers // to do for the pong to trigger the activity timers
LOG(("WebSocketChannel:: pong received\n")); LOG(("WebSocketChannel:: pong received\n"));
} else {
/* unknown control frame opcode */
LOG(("WebSocketChannel:: unknown control op code %d\n", opcode));
AbortSession(NS_ERROR_ILLEGAL_VALUE);
return NS_ERROR_ILLEGAL_VALUE;
} }
if (mFragmentAccumulator) { if (mFragmentAccumulator) {