[Modify] Polish it
This commit is contained in:
parent
ae2e23687b
commit
bcab731cd5
@ -664,8 +664,7 @@ namespace WebSocketSharp
|
|||||||
// As server
|
// As server
|
||||||
private bool acceptHandshake ()
|
private bool acceptHandshake ()
|
||||||
{
|
{
|
||||||
_logger.Debug (
|
_logger.Debug (String.Format ("A request from {0}:\n{1}", _context.UserEndPoint, _context));
|
||||||
String.Format ("A connection request from {0}:\n{1}", _context.UserEndPoint, _context));
|
|
||||||
|
|
||||||
var msg = checkIfValidHandshakeRequest (_context);
|
var msg = checkIfValidHandshakeRequest (_context);
|
||||||
if (msg != null) {
|
if (msg != null) {
|
||||||
@ -673,14 +672,16 @@ namespace WebSocketSharp
|
|||||||
throw new WebSocketException (CloseStatusCode.ProtocolError, msg);
|
throw new WebSocketException (CloseStatusCode.ProtocolError, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_protocol != null &&
|
if (_protocol != null
|
||||||
!_context.SecWebSocketProtocols.Contains (protocol => protocol == _protocol))
|
&& !_context.SecWebSocketProtocols.Contains (protocol => protocol == _protocol)
|
||||||
|
) {
|
||||||
_protocol = null;
|
_protocol = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!_ignoreExtensions) {
|
if (!_ignoreExtensions) {
|
||||||
var exts = _context.Headers["Sec-WebSocket-Extensions"];
|
var val = _context.Headers["Sec-WebSocket-Extensions"];
|
||||||
if (exts != null && exts.Length > 0)
|
if (val != null && val.Length > 0)
|
||||||
processSecWebSocketExtensionsHeader (exts);
|
processSecWebSocketExtensionsHeader (val);
|
||||||
}
|
}
|
||||||
|
|
||||||
return sendHttpResponse (createHandshakeResponse ());
|
return sendHttpResponse (createHandshakeResponse ());
|
||||||
|
Loading…
Reference in New Issue
Block a user