[Modify] Replace it

This commit is contained in:
sta 2016-01-30 16:11:34 +09:00
parent dcc56fa071
commit eaaba53442

View File

@ -677,11 +677,8 @@ namespace WebSocketSharp
throw new WebSocketException (CloseStatusCode.PolicyViolation, msg);
}
if (_protocol != null
&& !_context.SecWebSocketProtocols.Contains (protocol => protocol == _protocol)
) {
_protocol = null;
}
if (_protocol != null)
processSecWebSocketProtocolHeader (_context.SecWebSocketProtocols);
if (!_ignoreExtensions)
processSecWebSocketExtensionsHeader (_context.Headers["Sec-WebSocket-Extensions"]);
@ -1257,6 +1254,15 @@ namespace WebSocketSharp
}
}
// As server
private void processSecWebSocketProtocolHeader (IEnumerable<string> values)
{
if (values.Contains (p => p == _protocol))
return;
_protocol = null;
}
private bool processUnsupportedFrame (WebSocketFrame frame)
{
_logger.Fatal ("An unsupported frame:" + frame.PrintToString (false));