Commit b9cbd731 authored by justcoding121's avatar justcoding121 Committed by GitHub

Merge pull request #100 from justcoding121/release

enable Nagle algorithm
parents 8b46f917 63a8d938
......@@ -44,6 +44,7 @@ namespace Titanium.Web.Proxy.Network
public void Dispose()
{
Stream.Close();
Stream.Dispose();
TcpClient.LingerState = new LingerOption(true, 0);
......
......@@ -119,8 +119,6 @@ namespace Titanium.Web.Proxy.Network
stream.ReadTimeout = connectionTimeOutSeconds * 1000;
stream.WriteTimeout = connectionTimeOutSeconds * 1000;
client.NoDelay = true;
return new TcpConnection()
{
......@@ -133,7 +131,5 @@ namespace Titanium.Web.Proxy.Network
Version = httpVersion
};
}
}
}
......@@ -380,15 +380,11 @@ 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