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
2d2b72d4
Commit
2d2b72d4
authored
Apr 27, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Don't add 0-length DATA when response HEADERS bears END_STREAM flag
parent
b39ad313
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+2
-1
src/shrpx_downstream.h
src/shrpx_downstream.h
+6
-1
src/shrpx_http2_session.cc
src/shrpx_http2_session.cc
+4
-0
No files found.
src/shrpx_downstream.cc
View file @
2d2b72d4
...
@@ -740,7 +740,8 @@ bool Downstream::get_expect_final_response() const {
...
@@ -740,7 +740,8 @@ bool Downstream::get_expect_final_response() const {
}
}
bool
Downstream
::
expect_response_body
()
const
{
bool
Downstream
::
expect_response_body
()
const
{
return
http2
::
expect_response_body
(
req_
.
method
,
resp_
.
http_status
);
return
!
resp_
.
headers_only
&&
http2
::
expect_response_body
(
req_
.
method
,
resp_
.
http_status
);
}
}
namespace
{
namespace
{
...
...
src/shrpx_downstream.h
View file @
2d2b72d4
...
@@ -185,7 +185,8 @@ struct Response {
...
@@ -185,7 +185,8 @@ struct Response {
http_status
(
0
),
http_status
(
0
),
http_major
(
1
),
http_major
(
1
),
http_minor
(
1
),
http_minor
(
1
),
connection_close
(
false
)
{}
connection_close
(
false
),
headers_only
(
false
)
{}
void
consume
(
size_t
len
)
{
void
consume
(
size_t
len
)
{
assert
(
unconsumed_body_length
>=
len
);
assert
(
unconsumed_body_length
>=
len
);
...
@@ -202,6 +203,10 @@ struct Response {
...
@@ -202,6 +203,10 @@ struct Response {
unsigned
int
http_status
;
unsigned
int
http_status
;
int
http_major
,
http_minor
;
int
http_major
,
http_minor
;
bool
connection_close
;
bool
connection_close
;
// true if response only consists of HEADERS, and it bears
// END_STREAM. This is used to tell Http2Upstream that it can send
// response with single HEADERS with END_STREAM flag only.
bool
headers_only
;
};
};
class
Downstream
{
class
Downstream
{
...
...
src/shrpx_http2_session.cc
View file @
2d2b72d4
...
@@ -1024,6 +1024,10 @@ int on_response_headers(Http2Session *http2session, Downstream *downstream,
...
@@ -1024,6 +1024,10 @@ int on_response_headers(Http2Session *http2session, Downstream *downstream,
}
}
}
}
if
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_END_STREAM
)
{
resp
.
headers_only
=
true
;
}
rv
=
upstream
->
on_downstream_header_complete
(
downstream
);
rv
=
upstream
->
on_downstream_header_complete
(
downstream
);
if
(
rv
!=
0
)
{
if
(
rv
!=
0
)
{
// Handling early return (in other words, response was hijacked by
// Handling early return (in other words, response was hijacked by
...
...
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