[Modify] Rename it

This commit is contained in:
sta 2018-01-20 17:05:52 +09:00
parent 3dd4e6f6b7
commit c2b70b8d38

View File

@ -69,12 +69,12 @@ namespace WebSocketSharp.Net
private string _httpMethod; private string _httpMethod;
private Guid _identifier; private Guid _identifier;
private Stream _inputStream; private Stream _inputStream;
private Version _protocolVersion;
private NameValueCollection _queryString; private NameValueCollection _queryString;
private Uri _referer; private Uri _referer;
private string _uri; private string _uri;
private Uri _url; private Uri _url;
private string[] _userLanguages; private string[] _userLanguages;
private Version _version;
private bool _websocketRequest; private bool _websocketRequest;
private bool _websocketRequestSet; private bool _websocketRequestSet;
@ -324,7 +324,7 @@ namespace WebSocketSharp.Net
get { get {
if (!_websocketRequestSet) { if (!_websocketRequestSet) {
_websocketRequest = _httpMethod == "GET" _websocketRequest = _httpMethod == "GET"
&& _version > HttpVersion.Version10 && _protocolVersion > HttpVersion.Version10
&& _headers.Upgrades ("websocket"); && _headers.Upgrades ("websocket");
_websocketRequestSet = true; _websocketRequestSet = true;
@ -343,7 +343,7 @@ namespace WebSocketSharp.Net
/// </value> /// </value>
public bool KeepAlive { public bool KeepAlive {
get { get {
return _headers.KeepsAlive (_version); return _headers.KeepsAlive (_protocolVersion);
} }
} }
@ -368,7 +368,7 @@ namespace WebSocketSharp.Net
/// </value> /// </value>
public Version ProtocolVersion { public Version ProtocolVersion {
get { get {
return _version; return _protocolVersion;
} }
} }
@ -587,7 +587,7 @@ namespace WebSocketSharp.Net
{ {
var host = _headers["Host"]; var host = _headers["Host"];
var hasHost = host != null && host.Length > 0; var hasHost = host != null && host.Length > 0;
if (_version > HttpVersion.Version10 && !hasHost) { if (_protocolVersion > HttpVersion.Version10 && !hasHost) {
_context.ErrorMessage = "Invalid Host header"; _context.ErrorMessage = "Invalid Host header";
return; return;
} }
@ -606,7 +606,7 @@ namespace WebSocketSharp.Net
var transferEnc = _headers["Transfer-Encoding"]; var transferEnc = _headers["Transfer-Encoding"];
if (transferEnc != null) { if (transferEnc != null) {
if (_version < HttpVersion.Version11) { if (_protocolVersion < HttpVersion.Version11) {
_context.ErrorMessage = "Invalid Transfer-Encoding header"; _context.ErrorMessage = "Invalid Transfer-Encoding header";
return; return;
} }
@ -632,7 +632,7 @@ namespace WebSocketSharp.Net
} }
var expect = _headers["Expect"]; var expect = _headers["Expect"];
if (_version > HttpVersion.Version10 && expect != null) { if (_protocolVersion > HttpVersion.Version10 && expect != null) {
var comparison = StringComparison.OrdinalIgnoreCase; var comparison = StringComparison.OrdinalIgnoreCase;
if (!expect.Equals ("100-continue", comparison)) { if (!expect.Equals ("100-continue", comparison)) {
_context.ErrorMessage = "Invalid Expect header"; _context.ErrorMessage = "Invalid Expect header";
@ -727,7 +727,7 @@ namespace WebSocketSharp.Net
_httpMethod = method; _httpMethod = method;
_uri = uri; _uri = uri;
_version = ver; _protocolVersion = ver;
} }
#endregion #endregion
@ -810,7 +810,7 @@ namespace WebSocketSharp.Net
public override string ToString () public override string ToString ()
{ {
var buff = new StringBuilder (64); var buff = new StringBuilder (64);
buff.AppendFormat ("{0} {1} HTTP/{2}\r\n", _httpMethod, _uri, _version); buff.AppendFormat ("{0} {1} HTTP/{2}\r\n", _httpMethod, _uri, _protocolVersion);
buff.Append (_headers.ToString ()); buff.Append (_headers.ToString ());
return buff.ToString (); return buff.ToString ();