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

Commit 3e7c849

Browse files
committed
write to console enabled again in proxytestcontroller
1 parent b376227 commit 3e7c849

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void Stop()
119119
private async Task onBeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e)
120120
{
121121
string hostname = e.HttpClient.Request.RequestUri.Host;
122-
//await writeToConsole("Tunnel to: " + hostname);
122+
await writeToConsole("Tunnel to: " + hostname);
123123

124124
if (hostname.Contains("dropbox.com"))
125125
{
@@ -138,8 +138,8 @@ private Task onBeforeTunnelConnectResponse(object sender, TunnelConnectSessionEv
138138
// intecept & cancel redirect or update requests
139139
private async Task onRequest(object sender, SessionEventArgs e)
140140
{
141-
//await writeToConsole("Active Client Connections:" + ((ProxyServer)sender).ClientConnectionCount);
142-
//await writeToConsole(e.HttpClient.Request.Url);
141+
await writeToConsole("Active Client Connections:" + ((ProxyServer)sender).ClientConnectionCount);
142+
await writeToConsole(e.HttpClient.Request.Url);
143143

144144
// store it in the UserData property
145145
// It can be a simple integer, Guid, or any type
@@ -189,7 +189,7 @@ private async Task multipartRequestPartSent(object sender, MultipartRequestPartS
189189

190190
private async Task onResponse(object sender, SessionEventArgs e)
191191
{
192-
//await writeToConsole("Active Server Connections:" + ((ProxyServer)sender).ServerConnectionCount);
192+
await writeToConsole("Active Server Connections:" + ((ProxyServer)sender).ServerConnectionCount);
193193

194194
string ext = System.IO.Path.GetExtension(e.HttpClient.Request.RequestUri.AbsolutePath);
195195

src/Titanium.Web.Proxy/Network/Certificate/WinCertificateMaker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ private X509Certificate2 makeCertificate(string sSubjectCN, bool isRoot,
105105
// KeyLength
106106
const int keyLength = 2048;
107107

108-
var graceTime = DateTime.Now.AddDays(graceDays);
109108
var now = DateTime.Now;
109+
var graceTime = now.AddDays(graceDays);
110110
var certificate = makeCertificate(isRoot, sSubjectCN, fullSubject, keyLength, hashAlgo, graceTime,
111111
now.AddDays(validDays), isRoot ? null : signingCert);
112112
return certificate;

src/Titanium.Web.Proxy/Network/CertificateManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ internal async void ClearIdleCertificates()
483483
var cancellationToken = clearCertificatesTokenSource.Token;
484484
while (!cancellationToken.IsCancellationRequested)
485485
{
486-
var cutOff = DateTime.Now.AddMinutes(-1 * CertificateCacheTimeOutMinutes);
486+
var cutOff = DateTime.Now.AddMinutes(-CertificateCacheTimeOutMinutes);
487487

488488
var outdated = cachedCertificates.Where(x => x.Value.LastAccess < cutOff).ToList();
489489

src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ private async Task clearOutdatedConnections()
480480
{
481481
try
482482
{
483-
var cutOff = DateTime.Now.AddSeconds(-1 * Server.ConnectionTimeOutSeconds);
483+
var cutOff = DateTime.Now.AddSeconds(-Server.ConnectionTimeOutSeconds);
484484
foreach (var item in cache)
485485
{
486486
var queue = item.Value;

0 commit comments

Comments
 (0)