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
236e7563
Commit
236e7563
authored
Jan 01, 2018
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get buffer from bufferpool
parent
e7a9d66a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
HttpWebClient.cs
Titanium.Web.Proxy/Http/HttpWebClient.cs
+2
-0
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+13
-3
No files found.
Titanium.Web.Proxy/Http/HttpWebClient.cs
View file @
236e7563
...
@@ -174,6 +174,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -174,6 +174,7 @@ namespace Titanium.Web.Proxy.Http
Response
.
Is100Continue
=
true
;
Response
.
Is100Continue
=
true
;
Response
.
StatusCode
=
0
;
Response
.
StatusCode
=
0
;
await
ServerConnection
.
StreamReader
.
ReadLineAsync
();
await
ServerConnection
.
StreamReader
.
ReadLineAsync
();
//now receive response
//now receive response
await
ReceiveResponse
();
await
ReceiveResponse
();
return
;
return
;
...
@@ -186,6 +187,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -186,6 +187,7 @@ namespace Titanium.Web.Proxy.Http
Response
.
ExpectationFailed
=
true
;
Response
.
ExpectationFailed
=
true
;
Response
.
StatusCode
=
0
;
Response
.
StatusCode
=
0
;
await
ServerConnection
.
StreamReader
.
ReadLineAsync
();
await
ServerConnection
.
StreamReader
.
ReadLineAsync
();
//now receive response
//now receive response
await
ReceiveResponse
();
await
ReceiveResponse
();
return
;
return
;
...
...
Titanium.Web.Proxy/RequestHandler.cs
View file @
236e7563
...
@@ -7,6 +7,7 @@ using System.Net.Sockets;
...
@@ -7,6 +7,7 @@ using System.Net.Sockets;
using
System.Security.Authentication
;
using
System.Security.Authentication
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
StreamExtended
;
using
StreamExtended
;
using
StreamExtended.Helpers
;
using
StreamExtended.Network
;
using
StreamExtended.Network
;
using
Titanium.Web.Proxy.EventArguments
;
using
Titanium.Web.Proxy.EventArguments
;
using
Titanium.Web.Proxy.Exceptions
;
using
Titanium.Web.Proxy.Exceptions
;
...
@@ -166,9 +167,18 @@ namespace Titanium.Web.Proxy
...
@@ -166,9 +167,18 @@ namespace Titanium.Web.Proxy
if
(
clientStream
.
Available
>
0
)
if
(
clientStream
.
Available
>
0
)
{
{
//send the buffered data
//send the buffered data
var
data
=
new
byte
[
clientStream
.
Available
];
var
data
=
BufferPool
.
GetBuffer
(
BufferSize
);
await
clientStream
.
ReadAsync
(
data
,
0
,
data
.
Length
);
await
connection
.
StreamWriter
.
WriteAsync
(
data
,
true
);
try
{
// clientStream.Available sbould be at most BufferSize because it is using the same buffer size
await
clientStream
.
ReadAsync
(
data
,
0
,
clientStream
.
Available
);
await
connection
.
StreamWriter
.
WriteAsync
(
data
,
true
);
}
finally
{
BufferPool
.
ReturnBuffer
(
data
);
}
}
}
var
serverHelloInfo
=
await
SslTools
.
PeekServerHello
(
connection
.
Stream
);
var
serverHelloInfo
=
await
SslTools
.
PeekServerHello
(
connection
.
Stream
);
...
...
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