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
03205075
Commit
03205075
authored
May 20, 2016
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ConfigureAwait(false)
parent
4b86cde8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
StreamExtensions.cs
Titanium.Web.Proxy/Extensions/StreamExtensions.cs
+3
-3
HttpWebClient.cs
Titanium.Web.Proxy/Http/HttpWebClient.cs
+6
-6
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+1
-1
No files found.
Titanium.Web.Proxy/Extensions/StreamExtensions.cs
View file @
03205075
...
@@ -50,7 +50,7 @@ namespace Titanium.Web.Proxy.Extensions
...
@@ -50,7 +50,7 @@ namespace Titanium.Web.Proxy.Extensions
{
{
while
(
true
)
while
(
true
)
{
{
var
chuchkHead
=
await
clientStreamReader
.
ReadLineAsync
();
var
chuchkHead
=
await
clientStreamReader
.
ReadLineAsync
()
.
ConfigureAwait
(
false
)
;
var
chunkSize
=
int
.
Parse
(
chuchkHead
,
NumberStyles
.
HexNumber
);
var
chunkSize
=
int
.
Parse
(
chuchkHead
,
NumberStyles
.
HexNumber
);
if
(
chunkSize
!=
0
)
if
(
chunkSize
!=
0
)
...
@@ -58,11 +58,11 @@ namespace Titanium.Web.Proxy.Extensions
...
@@ -58,11 +58,11 @@ namespace Titanium.Web.Proxy.Extensions
var
buffer
=
await
clientStreamReader
.
ReadBytesAsync
(
chunkSize
);
var
buffer
=
await
clientStreamReader
.
ReadBytesAsync
(
chunkSize
);
await
stream
.
WriteAsync
(
buffer
,
0
,
buffer
.
Length
);
await
stream
.
WriteAsync
(
buffer
,
0
,
buffer
.
Length
);
//chunk trail
//chunk trail
await
clientStreamReader
.
ReadLineAsync
();
await
clientStreamReader
.
ReadLineAsync
()
.
ConfigureAwait
(
false
)
;
}
}
else
else
{
{
await
clientStreamReader
.
ReadLineAsync
();
await
clientStreamReader
.
ReadLineAsync
()
.
ConfigureAwait
(
false
)
;
break
;
break
;
}
}
}
}
...
...
Titanium.Web.Proxy/Http/HttpWebClient.cs
View file @
03205075
...
@@ -73,13 +73,13 @@ namespace Titanium.Web.Proxy.Http
...
@@ -73,13 +73,13 @@ namespace Titanium.Web.Proxy.Http
&&
responseStatusDescription
.
ToLower
().
Equals
(
"continue"
))
&&
responseStatusDescription
.
ToLower
().
Equals
(
"continue"
))
{
{
this
.
Request
.
Is100Continue
=
true
;
this
.
Request
.
Is100Continue
=
true
;
await
ProxyClient
.
ServerStreamReader
.
ReadLineAsync
();
await
ProxyClient
.
ServerStreamReader
.
ReadLineAsync
()
.
ConfigureAwait
(
false
)
;
}
}
else
if
(
responseStatusCode
.
Equals
(
"417"
)
else
if
(
responseStatusCode
.
Equals
(
"417"
)
&&
responseStatusDescription
.
ToLower
().
Equals
(
"expectation failed"
))
&&
responseStatusDescription
.
ToLower
().
Equals
(
"expectation failed"
))
{
{
this
.
Request
.
ExpectationFailed
=
true
;
this
.
Request
.
ExpectationFailed
=
true
;
await
ProxyClient
.
ServerStreamReader
.
ReadLineAsync
();
await
ProxyClient
.
ServerStreamReader
.
ReadLineAsync
()
.
ConfigureAwait
(
false
)
;
}
}
}
}
}
}
...
@@ -93,7 +93,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -93,7 +93,7 @@ namespace Titanium.Web.Proxy.Http
if
(
string
.
IsNullOrEmpty
(
httpResult
[
0
]))
if
(
string
.
IsNullOrEmpty
(
httpResult
[
0
]))
{
{
await
ProxyClient
.
ServerStreamReader
.
ReadLineAsync
();
await
ProxyClient
.
ServerStreamReader
.
ReadLineAsync
()
.
ConfigureAwait
(
false
)
;
}
}
this
.
Response
.
HttpVersion
=
httpResult
[
0
].
Trim
();
this
.
Response
.
HttpVersion
=
httpResult
[
0
].
Trim
();
...
@@ -106,7 +106,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -106,7 +106,7 @@ namespace Titanium.Web.Proxy.Http
{
{
this
.
Response
.
Is100Continue
=
true
;
this
.
Response
.
Is100Continue
=
true
;
this
.
Response
.
ResponseStatusCode
=
null
;
this
.
Response
.
ResponseStatusCode
=
null
;
await
ProxyClient
.
ServerStreamReader
.
ReadLineAsync
();
await
ProxyClient
.
ServerStreamReader
.
ReadLineAsync
()
.
ConfigureAwait
(
false
)
;
await
ReceiveResponse
();
await
ReceiveResponse
();
return
;
return
;
}
}
...
@@ -115,12 +115,12 @@ namespace Titanium.Web.Proxy.Http
...
@@ -115,12 +115,12 @@ namespace Titanium.Web.Proxy.Http
{
{
this
.
Response
.
ExpectationFailed
=
true
;
this
.
Response
.
ExpectationFailed
=
true
;
this
.
Response
.
ResponseStatusCode
=
null
;
this
.
Response
.
ResponseStatusCode
=
null
;
await
ProxyClient
.
ServerStreamReader
.
ReadLineAsync
();
await
ProxyClient
.
ServerStreamReader
.
ReadLineAsync
()
.
ConfigureAwait
(
false
)
;
await
ReceiveResponse
();
await
ReceiveResponse
();
return
;
return
;
}
}
List
<
string
>
responseLines
=
await
ProxyClient
.
ServerStreamReader
.
ReadAllLinesAsync
();
List
<
string
>
responseLines
=
await
ProxyClient
.
ServerStreamReader
.
ReadAllLinesAsync
()
.
ConfigureAwait
(
false
)
;
for
(
int
index
=
0
;
index
<
responseLines
.
Count
;
++
index
)
for
(
int
index
=
0
;
index
<
responseLines
.
Count
;
++
index
)
{
{
...
...
Titanium.Web.Proxy/RequestHandler.cs
View file @
03205075
...
@@ -34,7 +34,7 @@ namespace Titanium.Web.Proxy
...
@@ -34,7 +34,7 @@ namespace Titanium.Web.Proxy
{
{
//read the first line HTTP command
//read the first line HTTP command
var
httpCmd
=
await
clientStreamReader
.
ReadLineAsync
();
var
httpCmd
=
await
clientStreamReader
.
ReadLineAsync
()
.
ConfigureAwait
(
false
)
;
if
(
string
.
IsNullOrEmpty
(
httpCmd
))
if
(
string
.
IsNullOrEmpty
(
httpCmd
))
{
{
...
...
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