Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit d56086d

Browse files
committed
Increase default cache connection count
1 parent 8ce56f7 commit d56086d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/Titanium.Web.Proxy/ProxyServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ public ProxyServer(string? rootCertificateName, string? rootCertificateIssuerNam
208208
/// <summary>
209209
/// Maximum number of concurrent connections per remote host in cache.
210210
/// Only valid when connection pooling is enabled.
211-
/// Default value is 2.
211+
/// Default value is 4.
212212
/// </summary>
213-
public int MaxCachedConnections { get; set; } = 2;
213+
public int MaxCachedConnections { get; set; } = 4;
214214

215215
/// <summary>
216216
/// Number of seconds to linger when Tcp connection is in TIME_WAIT state.

tests/Titanium.Web.Proxy.IntegrationTests/NestedProxyTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ public async Task Nested_Proxy_Farm_With_Connection_Cache_Should_Not_Hang()
195195
var proxies2 = new List<ProxyServer>();
196196

197197
//create a level 2 upstream proxy farm that forwards to server
198-
for (int i = 0; i < 10; i++)
198+
for (int i = 0; i < 2; i++)
199199
{
200200
var proxy2 = testSuite.GetProxy();
201201
proxy2.ProxyBasicAuthenticateFunc += (_, _, _) =>
202202
{
203203
return Task.FromResult(true);
204204
};
205-
205+
proxy2.MaxCachedConnections = 100;
206206
proxies2.Add(proxy2);
207207
}
208208

@@ -212,9 +212,8 @@ public async Task Nested_Proxy_Farm_With_Connection_Cache_Should_Not_Hang()
212212
for (int i = 0; i < 10; i++)
213213
{
214214
var proxy1 = testSuite.GetProxy();
215-
//proxy1.EnableConnectionPool = false;
216215
var proxy2 = proxies2[rnd.Next() % proxies2.Count];
217-
216+
proxy1.MaxCachedConnections = 100;
218217
var explicitEndpoint = proxy1.ProxyEndPoints.OfType<ExplicitProxyEndPoint>().First();
219218
explicitEndpoint.BeforeTunnelConnectRequest += (_, e) =>
220219
{

0 commit comments

Comments
 (0)