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
d93842db
Commit
d93842db
authored
Jan 23, 2019
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Fix backend stall if header and request body are sent in 2 packets
parent
8dc2b263
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+6
-2
src/shrpx_downstream.h
src/shrpx_downstream.h
+1
-0
src/shrpx_http2_downstream_connection.cc
src/shrpx_http2_downstream_connection.cc
+13
-0
src/shrpx_http_downstream_connection.cc
src/shrpx_http_downstream_connection.cc
+19
-0
No files found.
src/shrpx_downstream.cc
View file @
d93842db
...
...
@@ -640,7 +640,7 @@ int Downstream::push_request_headers() {
int
Downstream
::
push_upload_data_chunk
(
const
uint8_t
*
data
,
size_t
datalen
)
{
req_
.
recv_body_length
+=
datalen
;
if
(
!
request_header_sent_
)
{
if
(
!
dconn_
&&
!
request_header_sent_
)
{
blocked_request_buf_
.
append
(
data
,
datalen
);
req_
.
unconsumed_body_length
+=
datalen
;
return
0
;
...
...
@@ -662,7 +662,7 @@ int Downstream::push_upload_data_chunk(const uint8_t *data, size_t datalen) {
}
int
Downstream
::
end_upload_data
()
{
if
(
!
request_header_sent_
)
{
if
(
!
dconn_
&&
!
request_header_sent_
)
{
blocked_request_data_eof_
=
true
;
return
0
;
}
...
...
@@ -1141,6 +1141,10 @@ bool Downstream::get_blocked_request_data_eof() const {
return
blocked_request_data_eof_
;
}
void
Downstream
::
set_blocked_request_data_eof
(
bool
f
)
{
blocked_request_data_eof_
=
f
;
}
void
Downstream
::
set_ws_key
(
const
StringRef
&
key
)
{
ws_key_
=
key
;
}
}
// namespace shrpx
src/shrpx_downstream.h
View file @
d93842db
...
...
@@ -388,6 +388,7 @@ public:
DefaultMemchunks
*
get_blocked_request_buf
();
bool
get_blocked_request_data_eof
()
const
;
void
set_blocked_request_data_eof
(
bool
f
);
// downstream response API
const
Response
&
response
()
const
{
return
resp_
;
}
...
...
src/shrpx_http2_downstream_connection.cc
View file @
d93842db
...
...
@@ -499,6 +499,14 @@ int Http2DownstreamConnection::push_request_headers() {
int
Http2DownstreamConnection
::
push_upload_data_chunk
(
const
uint8_t
*
data
,
size_t
datalen
)
{
if
(
!
downstream_
->
get_request_header_sent
())
{
auto
output
=
downstream_
->
get_blocked_request_buf
();
auto
&
req
=
downstream_
->
request
();
output
->
append
(
data
,
datalen
);
req
.
unconsumed_body_length
+=
datalen
;
return
0
;
}
int
rv
;
auto
output
=
downstream_
->
get_request_buf
();
output
->
append
(
data
,
datalen
);
...
...
@@ -516,6 +524,11 @@ int Http2DownstreamConnection::push_upload_data_chunk(const uint8_t *data,
}
int
Http2DownstreamConnection
::
end_upload_data
()
{
if
(
!
downstream_
->
get_request_header_sent
())
{
downstream_
->
set_blocked_request_data_eof
(
true
);
return
0
;
}
int
rv
;
if
(
downstream_
->
get_downstream_stream_id
()
!=
-
1
)
{
rv
=
http2session_
->
resume_data
(
this
);
...
...
src/shrpx_http_downstream_connection.cc
View file @
d93842db
...
...
@@ -705,6 +705,17 @@ int HttpDownstreamConnection::process_blocked_request_buf() {
int
HttpDownstreamConnection
::
push_upload_data_chunk
(
const
uint8_t
*
data
,
size_t
datalen
)
{
if
(
!
downstream_
->
get_request_header_sent
())
{
auto
output
=
downstream_
->
get_blocked_request_buf
();
auto
&
req
=
downstream_
->
request
();
output
->
append
(
data
,
datalen
);
req
.
unconsumed_body_length
+=
datalen
;
if
(
request_header_written_
)
{
signal_write
();
}
return
0
;
}
auto
chunked
=
downstream_
->
get_chunked_request
();
auto
output
=
downstream_
->
get_request_buf
();
...
...
@@ -726,6 +737,14 @@ int HttpDownstreamConnection::push_upload_data_chunk(const uint8_t *data,
}
int
HttpDownstreamConnection
::
end_upload_data
()
{
if
(
!
downstream_
->
get_request_header_sent
())
{
downstream_
->
set_blocked_request_data_eof
(
true
);
if
(
request_header_written_
)
{
signal_write
();
}
return
0
;
}
signal_write
();
if
(
!
downstream_
->
get_chunked_request
())
{
...
...
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