Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
9303cca4
Commit
9303cca4
authored
Jun 07, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send back Connection: keep-alive for the request with http/1.0 keep-alive
parent
73196201
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
examples/shrpx_downstream.cc
examples/shrpx_downstream.cc
+12
-0
examples/shrpx_downstream.h
examples/shrpx_downstream.h
+2
-0
examples/shrpx_https_upstream.cc
examples/shrpx_https_upstream.cc
+3
-0
No files found.
examples/shrpx_downstream.cc
View file @
9303cca4
...
...
@@ -116,6 +116,8 @@ void check_request_connection(bool *connection_close,
if
(
util
::
strieq
(
item
.
first
.
c_str
(),
"connection"
))
{
if
(
util
::
strifind
(
item
.
second
.
c_str
(),
"close"
))
{
*
connection_close
=
true
;
}
else
if
(
util
::
strifind
(
item
.
second
.
c_str
(),
"keep-alive"
))
{
*
connection_close
=
false
;
}
}
}
...
...
@@ -155,6 +157,16 @@ void Downstream::set_request_minor(int minor)
request_minor_
=
minor
;
}
int
Downstream
::
get_request_major
()
const
{
return
request_major_
;
}
int
Downstream
::
get_request_minor
()
const
{
return
request_minor_
;
}
Upstream
*
Downstream
::
get_upstream
()
const
{
return
upstream_
;
...
...
examples/shrpx_downstream.h
View file @
9303cca4
...
...
@@ -65,6 +65,8 @@ public:
void
set_request_path
(
const
std
::
string
&
path
);
void
set_request_major
(
int
major
);
void
set_request_minor
(
int
minor
);
int
get_request_major
()
const
;
int
get_request_minor
()
const
;
int
push_request_headers
();
bool
get_chunked_request
()
const
;
bool
get_request_connection_close
()
const
;
...
...
examples/shrpx_https_upstream.cc
View file @
9303cca4
...
...
@@ -476,6 +476,9 @@ int HttpsUpstream::on_downstream_header_complete(Downstream *downstream)
}
if
(
get_client_handler
()
->
get_should_close_after_write
())
{
hdrs
+=
"Connection: close
\r\n
"
;
}
else
if
(
downstream
->
get_request_major
()
==
1
&&
downstream
->
get_request_minor
()
==
0
)
{
hdrs
+=
"Connection: Keep-Alive
\r\n
"
;
}
hdrs
+=
"Via: "
;
hdrs
+=
via_value
;
...
...
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