bug 675919 - websockets fail connection on unknown control code. r=jduell
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user