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
80de6eac
Commit
80de6eac
authored
Mar 01, 2018
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handling keepalive properly when user respond in the BeforeRequest handler
parent
989b6cad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+10
-4
No files found.
Titanium.Web.Proxy/RequestHandler.cs
View file @
80de6eac
...
@@ -429,12 +429,20 @@ namespace Titanium.Web.Proxy
...
@@ -429,12 +429,20 @@ namespace Titanium.Web.Proxy
await
BeforeRequest
.
InvokeAsync
(
this
,
args
,
ExceptionFunc
);
await
BeforeRequest
.
InvokeAsync
(
this
,
args
,
ExceptionFunc
);
}
}
var
response
=
args
.
WebSession
.
Response
;
if
(
args
.
WebSession
.
Request
.
CancelRequest
)
if
(
args
.
WebSession
.
Request
.
CancelRequest
)
{
{
await
HandleHttpSessionResponse
(
args
);
await
HandleHttpSessionResponse
(
args
);
if
(!
response
.
KeepAlive
)
{
break
;
break
;
}
}
continue
;
}
//create a new connection if hostname/upstream end point changes
//create a new connection if hostname/upstream end point changes
if
(
connection
!=
null
if
(
connection
!=
null
&&
(!
connection
.
HostName
.
Equals
(
args
.
WebSession
.
Request
.
RequestUri
.
Host
,
StringComparison
.
OrdinalIgnoreCase
)
&&
(!
connection
.
HostName
.
Equals
(
args
.
WebSession
.
Request
.
RequestUri
.
Host
,
StringComparison
.
OrdinalIgnoreCase
)
...
@@ -450,8 +458,6 @@ namespace Titanium.Web.Proxy
...
@@ -450,8 +458,6 @@ namespace Titanium.Web.Proxy
connection
=
await
GetServerConnection
(
args
,
false
);
connection
=
await
GetServerConnection
(
args
,
false
);
}
}
var
response
=
args
.
WebSession
.
Response
;
//if upgrading to websocket then relay the requet without reading the contents
//if upgrading to websocket then relay the requet without reading the contents
if
(
args
.
WebSession
.
Request
.
UpgradeToWebSocket
)
if
(
args
.
WebSession
.
Request
.
UpgradeToWebSocket
)
{
{
...
@@ -491,7 +497,7 @@ namespace Titanium.Web.Proxy
...
@@ -491,7 +497,7 @@ namespace Titanium.Web.Proxy
await
HandleHttpSessionRequestInternal
(
connection
,
args
);
await
HandleHttpSessionRequestInternal
(
connection
,
args
);
//if connection is closing exit
//if connection is closing exit
if
(
response
.
KeepAlive
==
fals
e
)
if
(
!
response
.
KeepAliv
e
)
{
{
break
;
break
;
}
}
...
...
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