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
09bb22da
Commit
09bb22da
authored
Jun 05, 2017
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use non-static method
parent
d1f26f12
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
CustomBufferedStream.cs
Titanium.Web.Proxy/Helpers/CustomBufferedStream.cs
+5
-2
No files found.
Titanium.Web.Proxy/Helpers/CustomBufferedStream.cs
View file @
09bb22da
...
...
@@ -14,7 +14,7 @@ namespace Titanium.Web.Proxy.Helpers
/// <seealso cref="System.IO.Stream" />
internal
class
CustomBufferedStream
:
Stream
{
private
readonly
AsyncCallback
readCallback
=
R
eadCallback
;
private
AsyncCallback
r
eadCallback
;
private
readonly
Stream
baseStream
;
...
...
@@ -27,6 +27,7 @@ namespace Titanium.Web.Proxy.Helpers
private
int
bufferPos
;
private
bool
disposed
;
/// <summary>
/// Initializes a new instance of the <see cref="CustomBufferedStream"/> class.
/// </summary>
...
...
@@ -34,6 +35,7 @@ namespace Titanium.Web.Proxy.Helpers
/// <param name="bufferSize">Size of the buffer.</param>
public
CustomBufferedStream
(
Stream
baseStream
,
int
bufferSize
)
{
readCallback
=
new
AsyncCallback
(
ReadCallback
);
this
.
baseStream
=
baseStream
;
streamBuffer
=
BufferPool
.
GetBuffer
(
bufferSize
);
}
...
...
@@ -137,7 +139,7 @@ namespace Titanium.Web.Proxy.Helpers
return
result
;
}
private
static
void
ReadCallback
(
IAsyncResult
ar
)
private
void
ReadCallback
(
IAsyncResult
ar
)
{
var
readResult
=
(
ReadAsyncResult
)
ar
.
AsyncState
;
readResult
.
BaseResult
=
ar
;
...
...
@@ -363,6 +365,7 @@ namespace Titanium.Web.Proxy.Helpers
baseStream
.
Dispose
();
BufferPool
.
ReturnBuffer
(
streamBuffer
);
streamBuffer
=
null
;
readCallback
=
null
;
}
}
...
...
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