This repository was archived by the owner on Jul 9, 2023. It is now read-only.
File tree 3 files changed +15
-3
lines changed
3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ internal async void ClearIdleCertificates()
235
235
236
236
try
237
237
{
238
- var cutOff = DateTime . Now . AddSeconds ( - 60 ) ;
238
+ var cutOff = DateTime . Now . AddMinutes ( - 1 * ProxyServer . CertificateCacheTimeOutMinutes ) ;
239
239
240
240
var outdated = certificateCache
241
241
. Where ( x => x . Value . LastAccess < cutOff )
Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ internal async static void ClearIdleConnections()
206
206
await connectionAccessLock . WaitAsync ( ) ;
207
207
try
208
208
{
209
- var cutOff = DateTime . Now . AddSeconds ( - 60 ) ;
209
+ var cutOff = DateTime . Now . AddMinutes ( - 1 * ProxyServer . ConnectionCacheTimeOutMinutes ) ;
210
210
211
211
connectionCache
212
212
. SelectMany ( x => x . Value )
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ public partial class ProxyServer
21
21
22
22
static ProxyServer ( )
23
23
{
24
- ProxyEndPoints = new List < ProxyEndPoint > ( ) ;
24
+ ProxyEndPoints = new List < ProxyEndPoint > ( ) ;
25
+ ConnectionCacheTimeOutMinutes = 3 ;
26
+ CertificateCacheTimeOutMinutes = 60 ;
25
27
}
26
28
27
29
private static CertificateManager CertManager { get ; set ; }
@@ -32,6 +34,16 @@ static ProxyServer()
32
34
public static string RootCertificateIssuerName { get ; set ; }
33
35
public static string RootCertificateName { get ; set ; }
34
36
public static bool Enable100ContinueBehaviour { get ; set ; }
37
+
38
+ /// <summary>
39
+ /// Minutes TCP connection cache to servers to be kept alive when in idle state
40
+ /// </summary>
41
+ public static int ConnectionCacheTimeOutMinutes { get ; set ; }
42
+
43
+ /// <summary>
44
+ /// Minutes certificates should be kept in cache when not used
45
+ /// </summary>
46
+ public static int CertificateCacheTimeOutMinutes { get ; set ; }
35
47
36
48
public static event Func < object , SessionEventArgs , Task > BeforeRequest ;
37
49
public static event Func < object , SessionEventArgs , Task > BeforeResponse ;
You can’t perform that action at this time.
0 commit comments