Commit 12814410 authored by Hakan Arıcı's avatar Hakan Arıcı

Tabs are fixed as spaces.

parent 0b186431
...@@ -39,7 +39,7 @@ namespace Titanium.Web.Proxy.Http ...@@ -39,7 +39,7 @@ namespace Titanium.Web.Proxy.Http
/// </summary> /// </summary>
public bool IsHttps => this.Request.RequestUri.Scheme == Uri.UriSchemeHttps; public bool IsHttps => this.Request.RequestUri.Scheme == Uri.UriSchemeHttps;
/// <summary> /// <summary>
/// Set the tcp connection to server used by this webclient /// Set the tcp connection to server used by this webclient
/// </summary> /// </summary>
/// <param name="connection">Instance of <see cref="TcpConnection"/></param> /// <param name="connection">Instance of <see cref="TcpConnection"/></param>
...@@ -209,9 +209,9 @@ namespace Titanium.Web.Proxy.Http ...@@ -209,9 +209,9 @@ namespace Titanium.Web.Proxy.Http
{ {
var existing = Response.ResponseHeaders[newHeader.Name]; var existing = Response.ResponseHeaders[newHeader.Name];
var nonUniqueHeaders = new List<HttpHeader> {existing, newHeader}; var nonUniqueHeaders = new List<HttpHeader> {existing, newHeader};
Response.NonUniqueResponseHeaders.Add(newHeader.Name, nonUniqueHeaders); Response.NonUniqueResponseHeaders.Add(newHeader.Name, nonUniqueHeaders);
Response.ResponseHeaders.Remove(newHeader.Name); Response.ResponseHeaders.Remove(newHeader.Name);
} }
//add to unique header collection //add to unique header collection
......
...@@ -30,12 +30,12 @@ namespace Titanium.Web.Proxy ...@@ -30,12 +30,12 @@ namespace Titanium.Web.Proxy
//So for HTTPS requests client would send CONNECT header to negotiate a secure tcp tunnel via proxy //So for HTTPS requests client would send CONNECT header to negotiate a secure tcp tunnel via proxy
private async Task HandleClient(ExplicitProxyEndPoint endPoint, TcpClient tcpClient) private async Task HandleClient(ExplicitProxyEndPoint endPoint, TcpClient tcpClient)
{ {
var tcpRow = TcpHelper.GetExtendedTcpTable().FirstOrDefault( var tcpRow = TcpHelper.GetExtendedTcpTable().FirstOrDefault(
row => row.LocalEndPoint.Port == ((IPEndPoint) tcpClient.Client.RemoteEndPoint).Port); row => row.LocalEndPoint.Port == ((IPEndPoint) tcpClient.Client.RemoteEndPoint).Port);
var processId = tcpRow?.ProcessId ?? 0; var processId = tcpRow?.ProcessId ?? 0;
Stream clientStream = tcpClient.GetStream(); Stream clientStream = tcpClient.GetStream();
clientStream.ReadTimeout = ConnectionTimeOutSeconds * 1000; clientStream.ReadTimeout = ConnectionTimeOutSeconds * 1000;
clientStream.WriteTimeout = ConnectionTimeOutSeconds * 1000; clientStream.WriteTimeout = ConnectionTimeOutSeconds * 1000;
...@@ -175,12 +175,12 @@ namespace Titanium.Web.Proxy ...@@ -175,12 +175,12 @@ namespace Titanium.Web.Proxy
//So for HTTPS requests we would start SSL negotiation right away without expecting a CONNECT request from client //So for HTTPS requests we would start SSL negotiation right away without expecting a CONNECT request from client
private async Task HandleClient(TransparentProxyEndPoint endPoint, TcpClient tcpClient) private async Task HandleClient(TransparentProxyEndPoint endPoint, TcpClient tcpClient)
{ {
var tcpRow = TcpHelper.GetExtendedTcpTable().FirstOrDefault( var tcpRow = TcpHelper.GetExtendedTcpTable().FirstOrDefault(
row => row.LocalEndPoint.Port == ((IPEndPoint)tcpClient.Client.RemoteEndPoint).Port); row => row.LocalEndPoint.Port == ((IPEndPoint)tcpClient.Client.RemoteEndPoint).Port);
var processId = tcpRow?.ProcessId ?? 0; var processId = tcpRow?.ProcessId ?? 0;
Stream clientStream = tcpClient.GetStream(); Stream clientStream = tcpClient.GetStream();
clientStream.ReadTimeout = ConnectionTimeOutSeconds * 1000; clientStream.ReadTimeout = ConnectionTimeOutSeconds * 1000;
clientStream.WriteTimeout = ConnectionTimeOutSeconds * 1000; clientStream.WriteTimeout = ConnectionTimeOutSeconds * 1000;
...@@ -209,9 +209,9 @@ namespace Titanium.Web.Proxy ...@@ -209,9 +209,9 @@ namespace Titanium.Web.Proxy
} }
catch (Exception) catch (Exception)
{ {
sslStream.Dispose(); sslStream.Dispose();
Dispose(sslStream, clientStreamReader, clientStreamWriter, null); Dispose(sslStream, clientStreamReader, clientStreamWriter, null);
return; return;
} }
clientStream = sslStream; clientStream = sslStream;
...@@ -386,9 +386,9 @@ namespace Titanium.Web.Proxy ...@@ -386,9 +386,9 @@ namespace Titanium.Web.Proxy
var args = new SessionEventArgs(BUFFER_SIZE, HandleHttpSessionResponse); var args = new SessionEventArgs(BUFFER_SIZE, HandleHttpSessionResponse);
args.ProxyClient.TcpClient = client; args.ProxyClient.TcpClient = client;
args.WebSession.ConnectHeaders = connectHeaders; args.WebSession.ConnectHeaders = connectHeaders;
args.WebSession.ProcessId = processId; args.WebSession.ProcessId = processId;
try try
{ {
//break up the line into three components (method, remote URL & Http Version) //break up the line into three components (method, remote URL & Http Version)
var httpCmdSplit = httpCmd.Split(ProxyConstants.SpaceSplit, 3); var httpCmdSplit = httpCmd.Split(ProxyConstants.SpaceSplit, 3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment