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
6f9c9f85
Commit
6f9c9f85
authored
Sep 03, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Fix assertion failure when response was commited early
parent
65f2b161
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
src/shrpx_https_upstream.cc
src/shrpx_https_upstream.cc
+23
-0
No files found.
src/shrpx_https_upstream.cc
View file @
6f9c9f85
...
@@ -366,6 +366,17 @@ int htp_msg_completecb(http_parser *htp) {
...
@@ -366,6 +366,17 @@ int htp_msg_completecb(http_parser *htp) {
downstream
->
set_request_state
(
Downstream
::
MSG_COMPLETE
);
downstream
->
set_request_state
(
Downstream
::
MSG_COMPLETE
);
rv
=
downstream
->
end_upload_data
();
rv
=
downstream
->
end_upload_data
();
if
(
rv
!=
0
)
{
if
(
rv
!=
0
)
{
if
(
downstream
->
get_response_state
()
==
Downstream
::
MSG_COMPLETE
)
{
// Here both response and request were completed. One of the
// reason why end_upload_data() failed is when we sent response
// in request phase hook. We only delete and proceed to the
// next request handling (if we don't close the connection). We
// first pause parser here jsut as we normally do, and call
// signal_write() to run on_write().
http_parser_pause
(
htp
,
1
);
return
0
;
}
return
-
1
;
return
-
1
;
}
}
...
@@ -465,6 +476,13 @@ int HttpsUpstream::on_read() {
...
@@ -465,6 +476,13 @@ int HttpsUpstream::on_read() {
auto
htperr
=
HTTP_PARSER_ERRNO
(
&
htp_
);
auto
htperr
=
HTTP_PARSER_ERRNO
(
&
htp_
);
if
(
htperr
==
HPE_PAUSED
)
{
if
(
htperr
==
HPE_PAUSED
)
{
// We may pause parser in htp_msg_completecb when both side are
// completed. Signal write, so that we can run on_write().
if
(
downstream
&&
downstream
->
get_request_state
()
==
Downstream
::
MSG_COMPLETE
&&
downstream
->
get_response_state
()
==
Downstream
::
MSG_COMPLETE
)
{
handler_
->
signal_write
();
}
return
0
;
return
0
;
}
}
...
@@ -569,6 +587,11 @@ int HttpsUpstream::on_write() {
...
@@ -569,6 +587,11 @@ int HttpsUpstream::on_write() {
// We need this if response ends before request.
// We need this if response ends before request.
if
(
downstream
->
get_request_state
()
==
Downstream
::
MSG_COMPLETE
)
{
if
(
downstream
->
get_request_state
()
==
Downstream
::
MSG_COMPLETE
)
{
delete_downstream
();
delete_downstream
();
if
(
handler_
->
get_should_close_after_write
())
{
return
0
;
}
return
resume_read
(
SHRPX_NO_BUFFER
,
nullptr
,
0
);
return
resume_read
(
SHRPX_NO_BUFFER
,
nullptr
,
0
);
}
}
}
}
...
...
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