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
d2f4e4e3
Commit
d2f4e4e3
authored
Apr 27, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Always expect response trailer fields
parent
dba0f35e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+7
-0
src/shrpx_downstream.h
src/shrpx_downstream.h
+1
-0
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+2
-1
src/shrpx_http_downstream_connection.cc
src/shrpx_http_downstream_connection.cc
+7
-0
No files found.
src/shrpx_downstream.cc
View file @
d2f4e4e3
...
...
@@ -744,6 +744,13 @@ bool Downstream::expect_response_body() const {
http2
::
expect_response_body
(
req_
.
method
,
resp_
.
http_status
);
}
bool
Downstream
::
expect_response_trailer
()
const
{
// In HTTP/2, if final response HEADERS does not bear END_STREAM it
// is possible trailer fields might come, regardless of request
// method or status code.
return
!
resp_
.
headers_only
&&
resp_
.
http_major
==
2
;
}
namespace
{
void
reset_timer
(
struct
ev_loop
*
loop
,
ev_timer
*
w
)
{
ev_timer_again
(
loop
,
w
);
}
}
// namespace
...
...
src/shrpx_downstream.h
View file @
d2f4e4e3
...
...
@@ -278,6 +278,7 @@ public:
bool
validate_request_recv_body_length
()
const
;
void
set_request_downstream_host
(
const
StringRef
&
host
);
bool
expect_response_body
()
const
;
bool
expect_response_trailer
()
const
;
enum
{
INITIAL
,
HEADER_COMPLETE
,
...
...
src/shrpx_http2_upstream.cc
View file @
d2f4e4e3
...
...
@@ -1520,7 +1520,8 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) {
nghttp2_data_provider
*
data_prdptr
;
if
(
downstream
->
expect_response_body
())
{
if
(
downstream
->
expect_response_body
()
||
downstream
->
expect_response_trailer
())
{
data_prdptr
=
&
data_prd
;
}
else
{
data_prdptr
=
nullptr
;
...
...
src/shrpx_http_downstream_connection.cc
View file @
d2f4e4e3
...
...
@@ -604,6 +604,13 @@ int htp_hdrs_completecb(http_parser *htp) {
resp
.
http_major
=
htp
->
http_major
;
resp
.
http_minor
=
htp
->
http_minor
;
if
(
resp
.
http_major
>
1
)
{
// Normalize HTTP version, since we use http_major == 2 specially
// in Downstream::expect_response_trailer().
resp
.
http_major
=
1
;
resp
.
http_minor
=
1
;
}
if
(
resp
.
fs
.
parse_content_length
()
!=
0
)
{
downstream
->
set_response_state
(
Downstream
::
MSG_BAD_HEADER
);
return
-
1
;
...
...
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