public BaseTransportHeaders ReadHeaders() { string str; string str2; string str3; string str5; bool bSendContinue = false; BaseTransportHeaders headers = new BaseTransportHeaders(); this.ReadFirstLine(out str, out str2, out str3); if (((str == null) || (str2 == null)) || (str3 == null)) { throw new RemotingException(CoreChannel.GetResourceString("Remoting_Http_UnableToReadFirstLine")); } if (str3.Equals("HTTP/1.1")) { this._version = System.Runtime.Remoting.Channels.Http.HttpVersion.V1_1; } else if (str3.Equals("HTTP/1.0")) { this._version = System.Runtime.Remoting.Channels.Http.HttpVersion.V1_0; } else { this._version = System.Runtime.Remoting.Channels.Http.HttpVersion.V1_1; } if (this._version == System.Runtime.Remoting.Channels.Http.HttpVersion.V1_1) { this._keepAlive = true; } else { this._keepAlive = false; } if (HttpChannelHelper.ParseURL(str2, out str5) == null) { str5 = str2; } headers["__RequestVerb"] = str; headers.RequestUri = str5; headers["__HttpVersion"] = str3; if ((this._version == System.Runtime.Remoting.Channels.Http.HttpVersion.V1_1) && (str.Equals("POST") || str.Equals("PUT"))) { bSendContinue = true; } base.ReadToEndOfHeaders(headers, out this._chunkedEncoding, out this._contentLength, ref this._keepAlive, ref bSendContinue); if (bSendContinue && (this._version != System.Runtime.Remoting.Channels.Http.HttpVersion.V1_0)) { this.SendContinue(); } headers["__IPAddress"] = ((IPEndPoint)base.NetSocket.RemoteEndPoint).Address; headers["__ConnectionId"] = this._connectionId; return(headers); }
public BaseTransportHeaders ReadHeaders() { string str; string str2; string str3; string str5; bool bSendContinue = false; BaseTransportHeaders headers = new BaseTransportHeaders(); this.ReadFirstLine(out str, out str2, out str3); if (((str == null) || (str2 == null)) || (str3 == null)) { throw new RemotingException(CoreChannel.GetResourceString("Remoting_Http_UnableToReadFirstLine")); } if (str3.Equals("HTTP/1.1")) { this._version = System.Runtime.Remoting.Channels.Http.HttpVersion.V1_1; } else if (str3.Equals("HTTP/1.0")) { this._version = System.Runtime.Remoting.Channels.Http.HttpVersion.V1_0; } else { this._version = System.Runtime.Remoting.Channels.Http.HttpVersion.V1_1; } if (this._version == System.Runtime.Remoting.Channels.Http.HttpVersion.V1_1) { this._keepAlive = true; } else { this._keepAlive = false; } if (HttpChannelHelper.ParseURL(str2, out str5) == null) { str5 = str2; } headers["__RequestVerb"] = str; headers.RequestUri = str5; headers["__HttpVersion"] = str3; if ((this._version == System.Runtime.Remoting.Channels.Http.HttpVersion.V1_1) && (str.Equals("POST") || str.Equals("PUT"))) { bSendContinue = true; } base.ReadToEndOfHeaders(headers, out this._chunkedEncoding, out this._contentLength, ref this._keepAlive, ref bSendContinue); if (bSendContinue && (this._version != System.Runtime.Remoting.Channels.Http.HttpVersion.V1_0)) { this.SendContinue(); } headers["__IPAddress"] = ((IPEndPoint) base.NetSocket.RemoteEndPoint).Address; headers["__ConnectionId"] = this._connectionId; return headers; }