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
86d5e41d
Commit
86d5e41d
authored
Jun 22, 2016
by
titanium007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dispose TcpClient properly
parent
de3c7d86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
ResponseHandler.cs
Titanium.Web.Proxy/ResponseHandler.cs
+16
-6
No files found.
Titanium.Web.Proxy/ResponseHandler.cs
View file @
86d5e41d
...
@@ -181,14 +181,28 @@ namespace Titanium.Web.Proxy
...
@@ -181,14 +181,28 @@ namespace Titanium.Web.Proxy
/// <summary>
/// <summary>
/// Handle dispose of a client/server session
/// Handle dispose of a client/server session
/// </summary>
/// </summary>
/// <param name="
c
lient"></param>
/// <param name="
tcpC
lient"></param>
/// <param name="clientStream"></param>
/// <param name="clientStream"></param>
/// <param name="clientStreamReader"></param>
/// <param name="clientStreamReader"></param>
/// <param name="clientStreamWriter"></param>
/// <param name="clientStreamWriter"></param>
/// <param name="args"></param>
/// <param name="args"></param>
private
void
Dispose
(
TcpClient
c
lient
,
IDisposable
clientStream
,
IDisposable
clientStreamReader
,
private
void
Dispose
(
TcpClient
tcpC
lient
,
IDisposable
clientStream
,
IDisposable
clientStreamReader
,
IDisposable
clientStreamWriter
,
IDisposable
args
)
IDisposable
clientStreamWriter
,
IDisposable
args
)
{
{
if
(
clientStream
!=
null
)
{
(
clientStream
as
Stream
).
Close
();
(
clientStream
as
Stream
).
Dispose
();
}
if
(
tcpClient
!=
null
)
{
tcpClient
.
Client
.
Close
();
tcpClient
.
Close
();
tcpClient
.
Client
.
Dispose
();
}
if
(
args
!=
null
)
if
(
args
!=
null
)
args
.
Dispose
();
args
.
Dispose
();
...
@@ -198,11 +212,7 @@ namespace Titanium.Web.Proxy
...
@@ -198,11 +212,7 @@ namespace Titanium.Web.Proxy
if
(
clientStreamWriter
!=
null
)
if
(
clientStreamWriter
!=
null
)
clientStreamWriter
.
Dispose
();
clientStreamWriter
.
Dispose
();
if
(
clientStream
!=
null
)
clientStream
.
Dispose
();
if
(
client
!=
null
)
client
.
Close
();
}
}
}
}
}
}
\ 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