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
d1f26f12
Commit
d1f26f12
authored
Jun 05, 2017
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent dispose() called twice
parent
879c30ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
CustomBinaryReader.cs
Titanium.Web.Proxy/Helpers/CustomBinaryReader.cs
+1
-1
CustomBufferedStream.cs
Titanium.Web.Proxy/Helpers/CustomBufferedStream.cs
+10
-4
No files found.
Titanium.Web.Proxy/Helpers/CustomBinaryReader.cs
View file @
d1f26f12
...
@@ -15,7 +15,7 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -15,7 +15,7 @@ namespace Titanium.Web.Proxy.Helpers
private
readonly
CustomBufferedStream
stream
;
private
readonly
CustomBufferedStream
stream
;
private
readonly
Encoding
encoding
;
private
readonly
Encoding
encoding
;
private
volatile
bool
disposed
;
private
bool
disposed
;
internal
byte
[]
Buffer
{
get
;
}
internal
byte
[]
Buffer
{
get
;
}
...
...
Titanium.Web.Proxy/Helpers/CustomBufferedStream.cs
View file @
d1f26f12
...
@@ -14,7 +14,7 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -14,7 +14,7 @@ namespace Titanium.Web.Proxy.Helpers
/// <seealso cref="System.IO.Stream" />
/// <seealso cref="System.IO.Stream" />
internal
class
CustomBufferedStream
:
Stream
internal
class
CustomBufferedStream
:
Stream
{
{
private
static
readonly
AsyncCallback
readCallback
=
ReadCallback
;
private
readonly
AsyncCallback
readCallback
=
ReadCallback
;
private
readonly
Stream
baseStream
;
private
readonly
Stream
baseStream
;
...
@@ -26,6 +26,7 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -26,6 +26,7 @@ namespace Titanium.Web.Proxy.Helpers
private
int
bufferPos
;
private
int
bufferPos
;
private
bool
disposed
;
/// <summary>
/// <summary>
/// Initializes a new instance of the <see cref="CustomBufferedStream"/> class.
/// Initializes a new instance of the <see cref="CustomBufferedStream"/> class.
/// </summary>
/// </summary>
...
@@ -356,9 +357,14 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -356,9 +357,14 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
protected
override
void
Dispose
(
bool
disposing
)
protected
override
void
Dispose
(
bool
disposing
)
{
{
baseStream
.
Dispose
();
if
(!
disposed
)
BufferPool
.
ReturnBuffer
(
streamBuffer
);
{
streamBuffer
=
null
;
disposed
=
true
;
baseStream
.
Dispose
();
BufferPool
.
ReturnBuffer
(
streamBuffer
);
streamBuffer
=
null
;
}
}
}
/// <summary>
/// <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