[Modify] Replace it

This commit is contained in:
sta 2016-02-12 15:01:18 +09:00
parent 1ee1139da8
commit 47eeb50a77

View File

@ -80,6 +80,7 @@ namespace WebSocketSharp
private bool _enableRedirection; private bool _enableRedirection;
private AutoResetEvent _exitReceiving; private AutoResetEvent _exitReceiving;
private string _extensions; private string _extensions;
private bool _extensionsRequested;
private object _forConn; private object _forConn;
private object _forMessageEventQueue; private object _forMessageEventQueue;
private object _forSend; private object _forSend;
@ -267,13 +268,6 @@ namespace WebSocketSharp
} }
} }
// As client
internal bool ExtensionsRequested {
get {
return _compression != CompressionMethod.None;
}
}
internal bool HasMessage { internal bool HasMessage {
get { get {
lock (_forMessageEventQueue) lock (_forMessageEventQueue)
@ -944,9 +938,9 @@ namespace WebSocketSharp
if (_protocols != null) if (_protocols != null)
headers["Sec-WebSocket-Protocol"] = _protocols.ToString (", "); headers["Sec-WebSocket-Protocol"] = _protocols.ToString (", ");
var exts = createExtensions (); _extensionsRequested = _compression != CompressionMethod.None;
if (exts != null) if (_extensionsRequested)
headers["Sec-WebSocket-Extensions"] = exts; headers["Sec-WebSocket-Extensions"] = createExtensions ();
headers["Sec-WebSocket-Version"] = _version; headers["Sec-WebSocket-Version"] = _version;
@ -1015,7 +1009,7 @@ namespace WebSocketSharp
if (_protocols != null) if (_protocols != null)
_protocol = res.Headers["Sec-WebSocket-Protocol"]; _protocol = res.Headers["Sec-WebSocket-Protocol"];
if (ExtensionsRequested) if (_extensionsRequested)
processSecWebSocketExtensionsServerHeader (res.Headers["Sec-WebSocket-Extensions"]); processSecWebSocketExtensionsServerHeader (res.Headers["Sec-WebSocket-Extensions"]);
processCookies (res.Cookies); processCookies (res.Cookies);
@ -1705,7 +1699,7 @@ namespace WebSocketSharp
if (value.Length == 0) if (value.Length == 0)
return false; return false;
if (!ExtensionsRequested) if (!_extensionsRequested)
return false; return false;
var comp = _compression != CompressionMethod.None; var comp = _compression != CompressionMethod.None;