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
69b9ce6b
Commit
69b9ce6b
authored
Aug 20, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Fix possible deadlock due to exhaustion of send window
parent
c81e87bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
src/shrpx_http2_downstream_connection.cc
src/shrpx_http2_downstream_connection.cc
+14
-12
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+4
-2
src/shrpx_spdy_upstream.cc
src/shrpx_spdy_upstream.cc
+4
-2
No files found.
src/shrpx_http2_downstream_connection.cc
View file @
69b9ce6b
...
...
@@ -204,6 +204,20 @@ ssize_t http2_data_read_callback(nghttp2_session *session,
return
NGHTTP2_ERR_CALLBACK_FAILURE
;
}
if
(
nread
==
0
)
{
// This is important because it will handle flow control
// stuff.
if
(
downstream
->
get_upstream
()
->
resume_read
(
SHRPX_NO_BUFFER
,
downstream
)
!=
0
)
{
// In this case, downstream may be deleted.
return
NGHTTP2_ERR_CALLBACK_FAILURE
;
}
// Check dconn is still alive because Upstream::resume_read()
// may delete downstream which will delete dconn.
if
(
sd
->
dconn
==
nullptr
)
{
return
NGHTTP2_ERR_DEFERRED
;
}
if
(
downstream
->
get_request_state
()
==
Downstream
::
MSG_COMPLETE
)
{
if
(
!
downstream
->
get_upgrade_request
()
||
(
downstream
->
get_response_state
()
==
Downstream
::
HEADER_COMPLETE
&&
...
...
@@ -216,18 +230,6 @@ ssize_t http2_data_read_callback(nghttp2_session *session,
}
break
;
}
else
{
// This is important because it will handle flow control
// stuff.
if
(
downstream
->
get_upstream
()
->
resume_read
(
SHRPX_NO_BUFFER
,
downstream
)
!=
0
)
{
// In this case, downstream may be deleted.
return
NGHTTP2_ERR_CALLBACK_FAILURE
;
}
// Check dconn is still alive because Upstream::resume_read()
// may delete downstream which will delete dconn.
if
(
sd
->
dconn
==
nullptr
)
{
return
NGHTTP2_ERR_DEFERRED
;
}
if
(
evbuffer_get_length
(
body
)
==
0
)
{
// Check get_request_state() == MSG_COMPLETE just in case
if
(
downstream
->
get_request_state
()
==
Downstream
::
MSG_COMPLETE
)
{
...
...
src/shrpx_http2_upstream.cc
View file @
69b9ce6b
...
...
@@ -1101,12 +1101,14 @@ ssize_t downstream_data_read_callback(nghttp2_session *session,
downstream
->
disable_upstream_wtimer
();
}
if
(
nread
==
0
&&
((
*
data_flags
)
&
NGHTTP2_DATA_FLAG_EOF
)
==
0
)
{
if
(
nread
==
0
)
{
if
(
downstream
->
resume_read
(
SHRPX_NO_BUFFER
)
!=
0
)
{
return
NGHTTP2_ERR_CALLBACK_FAILURE
;
}
return
NGHTTP2_ERR_DEFERRED
;
if
(((
*
data_flags
)
&
NGHTTP2_DATA_FLAG_EOF
)
==
0
)
{
return
NGHTTP2_ERR_DEFERRED
;
}
}
return
nread
;
}
...
...
src/shrpx_spdy_upstream.cc
View file @
69b9ce6b
...
...
@@ -834,12 +834,14 @@ ssize_t spdy_data_read_callback(spdylay_session *session,
downstream
->
disable_upstream_wtimer
();
}
if
(
nread
==
0
&&
*
eof
!=
1
)
{
if
(
nread
==
0
)
{
if
(
downstream
->
resume_read
(
SHRPX_NO_BUFFER
)
!=
0
)
{
return
SPDYLAY_ERR_CALLBACK_FAILURE
;
}
return
SPDYLAY_ERR_DEFERRED
;
if
(
*
eof
!=
1
)
{
return
SPDYLAY_ERR_DEFERRED
;
}
}
return
nread
;
...
...
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