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
455759b0
Commit
455759b0
authored
May 13, 2017
by
justcoding121
Committed by
justcoding121
May 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
d09f92bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
24 deletions
+11
-24
TcpConnection.cs
Titanium.Web.Proxy/Network/Tcp/TcpConnection.cs
+3
-6
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+0
-5
ResponseHandler.cs
Titanium.Web.Proxy/ResponseHandler.cs
+8
-13
No files found.
Titanium.Web.Proxy/Network/Tcp/TcpConnection.cs
View file @
455759b0
...
@@ -52,14 +52,11 @@ namespace Titanium.Web.Proxy.Network.Tcp
...
@@ -52,14 +52,11 @@ namespace Titanium.Web.Proxy.Network.Tcp
/// </summary>
/// </summary>
public
void
Dispose
()
public
void
Dispose
()
{
{
Stream
.
Close
();
Stream
?.
Close
();
Stream
.
Dispose
();
Stream
?.
Dispose
();
StreamReader
?.
Dispose
();
TcpClient
.
LingerState
=
new
LingerOption
(
true
,
0
);
TcpClient
.
LingerState
=
new
LingerOption
(
true
,
0
);
TcpClient
.
Client
.
Shutdown
(
SocketShutdown
.
Both
);
TcpClient
.
Client
.
Close
();
TcpClient
.
Client
.
Dispose
();
TcpClient
.
Close
();
TcpClient
.
Close
();
}
}
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
455759b0
...
@@ -629,11 +629,6 @@ namespace Titanium.Web.Proxy
...
@@ -629,11 +629,6 @@ namespace Titanium.Web.Proxy
//It helps to avoid eventual deterioration of performance due to TCP port exhaustion
//It helps to avoid eventual deterioration of performance due to TCP port exhaustion
//due to default TCP CLOSE_WAIT timeout for 4 minutes
//due to default TCP CLOSE_WAIT timeout for 4 minutes
tcpClient
.
LingerState
=
new
LingerOption
(
true
,
0
);
tcpClient
.
LingerState
=
new
LingerOption
(
true
,
0
);
//the following 3 lines are unnecessary, tcpClient.Close() calls all of them internally
//tcpClient.Client.Shutdown(SocketShutdown.Both);
//tcpClient.Client.Close();
//tcpClient.Client.Dispose();
tcpClient
.
Close
();
tcpClient
.
Close
();
}
}
}
}
...
...
Titanium.Web.Proxy/ResponseHandler.cs
View file @
455759b0
...
@@ -50,7 +50,7 @@ namespace Titanium.Web.Proxy
...
@@ -50,7 +50,7 @@ namespace Titanium.Web.Proxy
await
Task
.
WhenAll
(
handlerTasks
);
await
Task
.
WhenAll
(
handlerTasks
);
}
}
if
(
args
.
ReRequest
)
if
(
args
.
ReRequest
)
{
{
await
HandleHttpSessionRequestInternal
(
null
,
args
,
null
,
null
,
true
);
await
HandleHttpSessionRequestInternal
(
null
,
args
,
null
,
null
,
true
);
return
;
return
;
...
@@ -124,7 +124,7 @@ namespace Titanium.Web.Proxy
...
@@ -124,7 +124,7 @@ namespace Titanium.Web.Proxy
await
args
.
ProxyClient
.
ClientStream
.
FlushAsync
();
await
args
.
ProxyClient
.
ClientStream
.
FlushAsync
();
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
ExceptionFunc
(
new
ProxyHttpException
(
"Error occured wilst handling session response"
,
e
,
args
));
ExceptionFunc
(
new
ProxyHttpException
(
"Error occured wilst handling session response"
,
e
,
args
));
Dispose
(
args
.
ProxyClient
.
ClientStream
,
args
.
ProxyClient
.
ClientStreamReader
,
Dispose
(
args
.
ProxyClient
.
ClientStream
,
args
.
ProxyClient
.
ClientStreamReader
,
...
@@ -231,20 +231,15 @@ namespace Titanium.Web.Proxy
...
@@ -231,20 +231,15 @@ namespace Titanium.Web.Proxy
private
void
Dispose
(
Stream
clientStream
,
CustomBinaryReader
clientStreamReader
,
private
void
Dispose
(
Stream
clientStream
,
CustomBinaryReader
clientStreamReader
,
StreamWriter
clientStreamWriter
,
IDisposable
args
)
StreamWriter
clientStreamWriter
,
IDisposable
args
)
{
{
clientStream
?.
Close
();
if
(
clientStream
!=
null
)
clientStream
?.
Dispose
();
{
clientStream
.
Close
();
clientStream
.
Dispose
();
}
args
?.
Dispose
();
clientStreamReader
?.
Dispose
();
clientStreamReader
?.
Dispose
();
if
(
clientStreamWriter
==
null
)
return
;
clientStreamWriter
?.
Close
();
clientStreamWriter
.
Close
();
clientStreamWriter
?.
Dispose
();
clientStreamWriter
.
Dispose
();
args
?.
Dispose
();
}
}
}
}
}
}
\ No newline at end of file
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