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
461f788a
Commit
461f788a
authored
Jan 02, 2018
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
long url requests fixed
parent
5fe25998
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
HttpWriter.cs
Titanium.Web.Proxy/Helpers/HttpWriter.cs
+7
-6
No files found.
Titanium.Web.Proxy/Helpers/HttpWriter.cs
View file @
461f788a
...
@@ -17,7 +17,9 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -17,7 +17,9 @@ namespace Titanium.Web.Proxy.Helpers
private
readonly
char
[]
charBuffer
;
private
readonly
char
[]
charBuffer
;
private
static
readonly
byte
[]
newLine
=
ProxyConstants
.
NewLine
;
private
static
readonly
byte
[]
newLine
=
ProxyConstants
.
NewLine
;
private
static
readonly
Encoding
encoding
=
Encoding
.
ASCII
;
private
static
readonly
Encoder
encoder
=
Encoding
.
ASCII
.
GetEncoder
();
private
static
readonly
Encoder
encoder
=
Encoding
.
ASCII
.
GetEncoder
();
internal
HttpWriter
(
Stream
stream
,
int
bufferSize
)
:
base
(
stream
)
internal
HttpWriter
(
Stream
stream
,
int
bufferSize
)
:
base
(
stream
)
...
@@ -36,10 +38,10 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -36,10 +38,10 @@ namespace Titanium.Web.Proxy.Helpers
public
async
Task
WriteAsync
(
string
value
)
public
async
Task
WriteAsync
(
string
value
)
{
{
int
charCount
=
value
.
Length
;
int
charCount
=
value
.
Length
;
value
.
CopyTo
(
0
,
charBuffer
,
0
,
charCount
);
if
(
charCount
<
BufferSize
)
if
(
charCount
<
BufferSize
)
{
{
value
.
CopyTo
(
0
,
charBuffer
,
0
,
charCount
);
var
buffer
=
BufferPool
.
GetBuffer
(
BufferSize
);
var
buffer
=
BufferPool
.
GetBuffer
(
BufferSize
);
try
try
{
{
...
@@ -53,9 +55,8 @@ namespace Titanium.Web.Proxy.Helpers
...
@@ -53,9 +55,8 @@ namespace Titanium.Web.Proxy.Helpers
}
}
else
else
{
{
var
buffer
=
new
byte
[
charCount
+
1
];
var
buffer
=
encoding
.
GetBytes
(
value
);
int
idx
=
encoder
.
GetBytes
(
charBuffer
,
0
,
charCount
,
buffer
,
0
,
true
);
await
WriteAsync
(
buffer
);
await
WriteAsync
(
buffer
,
0
,
idx
);
}
}
}
}
...
...
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