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
2909c05d
Commit
2909c05d
authored
May 16, 2017
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#232 experimental fix
parent
6c15f3c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
CustomBinaryReader.cs
Titanium.Web.Proxy/Helpers/CustomBinaryReader.cs
+14
-2
No files found.
Titanium.Web.Proxy/Helpers/CustomBinaryReader.cs
View file @
2909c05d
...
@@ -19,7 +19,10 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -19,7 +19,10 @@ namespace Titanium.Web.Proxy.Helpers
private
readonly
byte
[]
staticBuffer
;
private
readonly
byte
[]
staticBuffer
;
private
readonly
Encoding
encoding
;
private
readonly
Encoding
encoding
;
private
static
readonly
ConcurrentQueue
<
byte
[
]>
buffers
=
new
ConcurrentQueue
<
byte
[
]>
();
private
static
readonly
ConcurrentQueue
<
byte
[
]>
buffers
=
new
ConcurrentQueue
<
byte
[
]>
();
private
volatile
bool
disposed
=
false
;
internal
CustomBinaryReader
(
CustomBufferedStream
stream
,
int
bufferSize
)
internal
CustomBinaryReader
(
CustomBufferedStream
stream
,
int
bufferSize
)
{
{
...
@@ -154,9 +157,18 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -154,9 +157,18 @@ namespace Titanium.Web.Proxy.Helpers
public
void
Dispose
()
public
void
Dispose
()
{
{
buffers
.
Enqueue
(
staticBuffer
);
if
(!
disposed
)
{
disposed
=
true
;
buffers
.
Enqueue
(
staticBuffer
);
}
}
}
/// <summary>
/// Increase size of buffer and copy existing content to new buffer
/// </summary>
/// <param name="buffer"></param>
/// <param name="size"></param>
private
void
ResizeBuffer
(
ref
byte
[]
buffer
,
long
size
)
private
void
ResizeBuffer
(
ref
byte
[]
buffer
,
long
size
)
{
{
var
newBuffer
=
new
byte
[
size
];
var
newBuffer
=
new
byte
[
size
];
...
...
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