[Modify] Polish it
This commit is contained in:
parent
c186c4ab56
commit
39ce4997bd
@ -481,15 +481,17 @@ Extended Payload Length: {7}
|
||||
throw new WebSocketException (CloseStatusCode.ProtocolError, msg);
|
||||
}
|
||||
|
||||
if (opcode.IsControl () && fin == Fin.More) {
|
||||
if (opcode.IsControl ()) {
|
||||
if (fin == Fin.More) {
|
||||
var msg = "A control frame is fragmented.";
|
||||
throw new WebSocketException (CloseStatusCode.ProtocolError, msg);
|
||||
}
|
||||
|
||||
if (opcode.IsControl () && payloadLen > 125) {
|
||||
if (payloadLen > 125) {
|
||||
var msg = "A control frame has too long payload length.";
|
||||
throw new WebSocketException (CloseStatusCode.ProtocolError, msg);
|
||||
}
|
||||
}
|
||||
|
||||
var frame = new WebSocketFrame ();
|
||||
frame._fin = fin;
|
||||
|
Loading…
Reference in New Issue
Block a user