Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
367d6dcd
Commit
367d6dcd
authored
Dec 26, 2019
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now=>UtcNow
parent
987dafc9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
20 deletions
+20
-20
SessionEventArgsBase.cs
...Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs
+1
-1
HttpWebClient.cs
src/Titanium.Web.Proxy/Http/HttpWebClient.cs
+1
-1
WinCertificateMaker.cs
...nium.Web.Proxy/Network/Certificate/WinCertificateMaker.cs
+1
-1
CertificateManager.cs
src/Titanium.Web.Proxy/Network/CertificateManager.cs
+2
-2
TcpConnectionFactory.cs
src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
+7
-7
TcpServerConnection.cs
src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs
+1
-1
State.cs
src/Titanium.Web.Proxy/Network/WinAuth/Security/State.cs
+2
-2
RequestHandler.cs
src/Titanium.Web.Proxy/RequestHandler.cs
+3
-3
ResponseHandler.cs
src/Titanium.Web.Proxy/ResponseHandler.cs
+2
-2
No files found.
src/Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs
View file @
367d6dcd
...
...
@@ -53,7 +53,7 @@ namespace Titanium.Web.Proxy.EventArguments
{
BufferPool
=
server
.
BufferPool
;
ExceptionFunc
=
server
.
ExceptionFunc
;
TimeLine
[
"Session Created"
]
=
DateTime
.
Now
;
TimeLine
[
"Session Created"
]
=
DateTime
.
Utc
Now
;
CancellationTokenSource
=
cancellationTokenSource
;
...
...
src/Titanium.Web.Proxy/Http/HttpWebClient.cs
View file @
367d6dcd
...
...
@@ -92,7 +92,7 @@ namespace Titanium.Web.Proxy.Http
/// <param name="serverConnection">Instance of <see cref="TcpServerConnection" /></param>
internal
void
SetConnection
(
TcpServerConnection
serverConnection
)
{
serverConnection
.
LastAccess
=
DateTime
.
Now
;
serverConnection
.
LastAccess
=
DateTime
.
Utc
Now
;
connection
=
serverConnection
;
}
...
...
src/Titanium.Web.Proxy/Network/Certificate/WinCertificateMaker.cs
View file @
367d6dcd
...
...
@@ -105,7 +105,7 @@ namespace Titanium.Web.Proxy.Network.Certificate
// KeyLength
const
int
keyLength
=
2048
;
var
now
=
DateTime
.
Now
;
var
now
=
DateTime
.
Utc
Now
;
var
graceTime
=
now
.
AddDays
(
graceDays
);
var
certificate
=
makeCertificate
(
sSubjectCN
,
fullSubject
,
keyLength
,
hashAlgo
,
graceTime
,
now
.
AddDays
(
validDays
),
signingCertificate
);
...
...
src/Titanium.Web.Proxy/Network/CertificateManager.cs
View file @
367d6dcd
...
...
@@ -459,7 +459,7 @@ namespace Titanium.Web.Proxy.Network
// check in cache first
if
(
cachedCertificates
.
TryGetValue
(
certificateName
,
out
var
cached
))
{
cached
.
LastAccess
=
DateTime
.
Now
;
cached
.
LastAccess
=
DateTime
.
Utc
Now
;
return
cached
.
Certificate
;
}
...
...
@@ -498,7 +498,7 @@ namespace Titanium.Web.Proxy.Network
var
cancellationToken
=
clearCertificatesTokenSource
.
Token
;
while
(!
cancellationToken
.
IsCancellationRequested
)
{
var
cutOff
=
DateTime
.
Now
.
AddMinutes
(-
CertificateCacheTimeOutMinutes
);
var
cutOff
=
DateTime
.
Utc
Now
.
AddMinutes
(-
CertificateCacheTimeOutMinutes
);
var
outdated
=
cachedCertificates
.
Where
(
x
=>
x
.
Value
.
LastAccess
<
cutOff
).
ToList
();
...
...
src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
367d6dcd
...
...
@@ -241,7 +241,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
if
(
cache
.
TryGetValue
(
cacheKey
,
out
var
existingConnections
))
{
// +3 seconds for potential delay after getting connection
var
cutOff
=
DateTime
.
Now
.
AddSeconds
(-
proxyServer
.
ConnectionTimeOutSeconds
+
3
);
var
cutOff
=
DateTime
.
Utc
Now
.
AddSeconds
(-
proxyServer
.
ConnectionTimeOutSeconds
+
3
);
while
(
existingConnections
.
Count
>
0
)
{
if
(
existingConnections
.
TryDequeue
(
out
var
recentConnection
))
...
...
@@ -350,7 +350,7 @@ retry:
if
(
sessionArgs
!=
null
)
{
sessionArgs
.
TimeLine
[
"Dns Resolved"
]
=
DateTime
.
Now
;
sessionArgs
.
TimeLine
[
"Dns Resolved"
]
=
DateTime
.
Utc
Now
;
}
Array
.
Sort
(
ipAddresses
,
(
x
,
y
)
=>
x
.
AddressFamily
.
CompareTo
(
y
.
AddressFamily
));
...
...
@@ -458,7 +458,7 @@ retry:
if
(
newUpstreamProxy
!=
null
)
{
sessionArgs
.
CustomUpStreamProxyUsed
=
newUpstreamProxy
;
sessionArgs
.
TimeLine
[
"Retrying Upstream Proxy Connection"
]
=
DateTime
.
Now
;
sessionArgs
.
TimeLine
[
"Retrying Upstream Proxy Connection"
]
=
DateTime
.
Utc
Now
;
return
await
createServerConnection
(
remoteHostName
,
remotePort
,
httpVersion
,
isHttps
,
sslProtocol
,
applicationProtocols
,
isConnect
,
proxyServer
,
sessionArgs
,
upStreamEndPoint
,
externalProxy
,
cacheKey
,
cancellationToken
);
}
}
...
...
@@ -468,7 +468,7 @@ retry:
if
(
sessionArgs
!=
null
)
{
sessionArgs
.
TimeLine
[
"Connection Established"
]
=
DateTime
.
Now
;
sessionArgs
.
TimeLine
[
"Connection Established"
]
=
DateTime
.
Utc
Now
;
}
await
proxyServer
.
InvokeServerConnectionCreateEvent
(
tcpServerSocket
);
...
...
@@ -532,7 +532,7 @@ retry:
if
(
sessionArgs
!=
null
)
{
sessionArgs
.
TimeLine
[
"HTTPS Established"
]
=
DateTime
.
Now
;
sessionArgs
.
TimeLine
[
"HTTPS Established"
]
=
DateTime
.
Utc
Now
;
}
}
}
...
...
@@ -570,7 +570,7 @@ retry:
return
;
}
connection
.
LastAccess
=
DateTime
.
Now
;
connection
.
LastAccess
=
DateTime
.
Utc
Now
;
try
{
...
...
@@ -634,7 +634,7 @@ retry:
{
try
{
var
cutOff
=
DateTime
.
Now
.
AddSeconds
(-
Server
.
ConnectionTimeOutSeconds
);
var
cutOff
=
DateTime
.
Utc
Now
.
AddSeconds
(-
Server
.
ConnectionTimeOutSeconds
);
foreach
(
var
item
in
cache
)
{
var
queue
=
item
.
Value
;
...
...
src/Titanium.Web.Proxy/Network/Tcp/TcpServerConnection.cs
View file @
367d6dcd
...
...
@@ -20,7 +20,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
Version
version
,
IExternalProxy
?
upStreamProxy
,
IPEndPoint
?
upStreamEndPoint
,
string
cacheKey
)
{
TcpSocket
=
tcpSocket
;
LastAccess
=
DateTime
.
Now
;
LastAccess
=
DateTime
.
Utc
Now
;
this
.
proxyServer
=
proxyServer
;
this
.
proxyServer
.
UpdateServerConnectionCount
(
true
);
Stream
=
stream
;
...
...
src/Titanium.Web.Proxy/Network/WinAuth/Security/State.cs
View file @
367d6dcd
...
...
@@ -43,7 +43,7 @@ namespace Titanium.Web.Proxy.Network.WinAuth.Security
Credentials
=
new
Common
.
SecurityHandle
(
0
);
Context
=
new
Common
.
SecurityHandle
(
0
);
LastSeen
=
DateTime
.
Now
;
LastSeen
=
DateTime
.
Utc
Now
;
AuthState
=
WinAuthState
.
UNAUTHORIZED
;
}
...
...
@@ -56,7 +56,7 @@ namespace Titanium.Web.Proxy.Network.WinAuth.Security
internal
void
UpdatePresence
()
{
LastSeen
=
DateTime
.
Now
;
LastSeen
=
DateTime
.
Utc
Now
;
}
}
}
src/Titanium.Web.Proxy/RequestHandler.cs
View file @
367d6dcd
...
...
@@ -279,7 +279,7 @@ namespace Titanium.Web.Proxy
// set the connection and send request headers
args
.
HttpClient
.
SetConnection
(
connection
);
args
.
TimeLine
[
"Connection Ready"
]
=
DateTime
.
Now
;
args
.
TimeLine
[
"Connection Ready"
]
=
DateTime
.
Utc
Now
;
if
(
args
.
HttpClient
.
Request
.
UpgradeToWebSocket
)
{
...
...
@@ -335,7 +335,7 @@ namespace Titanium.Web.Proxy
}
}
args
.
TimeLine
[
"Request Sent"
]
=
DateTime
.
Now
;
args
.
TimeLine
[
"Request Sent"
]
=
DateTime
.
Utc
Now
;
// parse and send response
await
handleHttpSessionResponse
(
args
);
...
...
@@ -374,7 +374,7 @@ namespace Titanium.Web.Proxy
/// <returns></returns>
private
async
Task
onBeforeRequest
(
SessionEventArgs
args
)
{
args
.
TimeLine
[
"Request Received"
]
=
DateTime
.
Now
;
args
.
TimeLine
[
"Request Received"
]
=
DateTime
.
Utc
Now
;
if
(
BeforeRequest
!=
null
)
{
...
...
src/Titanium.Web.Proxy/ResponseHandler.cs
View file @
367d6dcd
...
...
@@ -32,7 +32,7 @@ namespace Titanium.Web.Proxy
await
args
.
HttpClient
.
ReceiveResponse
(
cancellationToken
);
}
args
.
TimeLine
[
"Response Received"
]
=
DateTime
.
Now
;
args
.
TimeLine
[
"Response Received"
]
=
DateTime
.
Utc
Now
;
var
response
=
args
.
HttpClient
.
Response
;
args
.
ReRequest
=
false
;
...
...
@@ -122,7 +122,7 @@ namespace Titanium.Web.Proxy
}
}
args
.
TimeLine
[
"Response Sent"
]
=
DateTime
.
Now
;
args
.
TimeLine
[
"Response Sent"
]
=
DateTime
.
Utc
Now
;
}
/// <summary>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment