Commit 63a8d938 authored by justcoding121's avatar justcoding121

enable Nagle algorithm

parent e1cf60d6
......@@ -44,6 +44,7 @@ namespace Titanium.Web.Proxy.Network
public void Dispose()
{
Stream.Close();
Stream.Dispose();
TcpClient.LingerState = new LingerOption(true, 0);
......
......@@ -120,8 +120,6 @@ namespace Titanium.Web.Proxy.Network
stream.ReadTimeout = connectionTimeOutSeconds * 1000;
stream.WriteTimeout = connectionTimeOutSeconds * 1000;
client.NoDelay = true;
return new TcpConnection()
{
HostName = remoteHostName,
......@@ -133,7 +131,5 @@ namespace Titanium.Web.Proxy.Network
Version = httpVersion
};
}
}
}
......@@ -381,14 +381,10 @@ namespace Titanium.Web.Proxy
if (tcpClient != null)
{
Task.Run(async () =>
{
try
{
tcpClient.NoDelay = true;
if (endPoint.GetType() == typeof(TransparentProxyEndPoint))
{
await HandleClient(endPoint as TransparentProxyEndPoint, tcpClient);
......
......@@ -7,6 +7,7 @@ using Titanium.Web.Proxy.Compression;
using System.Threading.Tasks;
using Titanium.Web.Proxy.Extensions;
using Titanium.Web.Proxy.Http;
using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy
{
......@@ -214,8 +215,8 @@ namespace Titanium.Web.Proxy
/// <param name="clientStreamReader"></param>
/// <param name="clientStreamWriter"></param>
/// <param name="args"></param>
private void Dispose(Stream clientStream, IDisposable clientStreamReader,
IDisposable clientStreamWriter, IDisposable args)
private void Dispose(Stream clientStream, CustomBinaryReader clientStreamReader,
StreamWriter clientStreamWriter, IDisposable args)
{
if (clientStream != null)
......@@ -236,6 +237,7 @@ namespace Titanium.Web.Proxy
if (clientStreamWriter != null)
{
clientStreamWriter.Close();
clientStreamWriter.Dispose();
}
}
......
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