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
ab632d8e
Commit
ab632d8e
authored
May 17, 2018
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor prefetch release
parent
53b77f53
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
31 deletions
+20
-31
ExplicitClientHandler.cs
Titanium.Web.Proxy/ExplicitClientHandler.cs
+1
-9
TcpConnectionFactory.cs
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
+17
-0
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+1
-13
TransparentClientHandler.cs
Titanium.Web.Proxy/TransparentClientHandler.cs
+1
-9
No files found.
Titanium.Web.Proxy/ExplicitClientHandler.cs
View file @
ab632d8e
...
...
@@ -341,15 +341,7 @@ namespace Titanium.Web.Proxy
if
(!
calledRequestHandler
&&
prefetchConnectionTask
!=
null
)
{
TcpServerConnection
prefetchedConnection
=
null
;
try
{
prefetchedConnection
=
await
prefetchConnectionTask
;
}
finally
{
await
tcpConnectionFactory
.
Release
(
prefetchedConnection
,
closeServerConnection
);
}
await
tcpConnectionFactory
.
Release
(
prefetchConnectionTask
,
closeServerConnection
);
}
clientStream
.
Dispose
();
...
...
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
ab632d8e
...
...
@@ -403,6 +403,23 @@ namespace Titanium.Web.Proxy.Network.Tcp
}
}
internal
async
Task
Release
(
Task
<
TcpServerConnection
>
connectionCreateTask
,
bool
closeServerConnection
)
{
if
(
connectionCreateTask
!=
null
)
{
TcpServerConnection
connection
=
null
;
try
{
connection
=
await
connectionCreateTask
;
}
catch
{
}
finally
{
await
Release
(
connection
,
closeServerConnection
);
}
}
}
private
async
Task
clearOutdatedConnections
()
{
while
(
runCleanUpTask
)
...
...
Titanium.Web.Proxy/RequestHandler.cs
View file @
ab632d8e
...
...
@@ -280,19 +280,7 @@ namespace Titanium.Web.Proxy
await
tcpConnectionFactory
.
Release
(
connection
,
closeServerConnection
);
if
(
prefetchTask
!=
null
)
{
TcpServerConnection
prefetchedConnection
=
null
;
try
{
prefetchedConnection
=
await
prefetchTask
;
}
finally
{
await
tcpConnectionFactory
.
Release
(
prefetchedConnection
,
closeServerConnection
);
}
}
await
tcpConnectionFactory
.
Release
(
prefetchTask
,
closeServerConnection
);
}
}
...
...
Titanium.Web.Proxy/TransparentClientHandler.cs
View file @
ab632d8e
...
...
@@ -167,15 +167,7 @@ namespace Titanium.Web.Proxy
if
(!
calledRequestHandler
&&
prefetchConnectionTask
!=
null
)
{
TcpServerConnection
prefetchedConnection
=
null
;
try
{
prefetchedConnection
=
await
prefetchConnectionTask
;
}
finally
{
await
tcpConnectionFactory
.
Release
(
prefetchedConnection
,
closeServerConnection
);
}
await
tcpConnectionFactory
.
Release
(
prefetchConnectionTask
,
closeServerConnection
);
}
clientStream
.
Dispose
();
...
...
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