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
67669bf3
Commit
67669bf3
authored
Jun 05, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete downstream if SPDY stream has been already closed
parent
e8cefa92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
examples/shrpx_spdy_upstream.cc
examples/shrpx_spdy_upstream.cc
+10
-13
No files found.
examples/shrpx_spdy_upstream.cc
View file @
67669bf3
...
...
@@ -272,18 +272,17 @@ void spdy_downstream_readcb(bufferevent *bev, void *ptr)
Downstream
*
downstream
=
reinterpret_cast
<
Downstream
*>
(
ptr
);
SpdyUpstream
*
upstream
;
upstream
=
static_cast
<
SpdyUpstream
*>
(
downstream
->
get_upstream
());
int
rv
=
downstream
->
parse_http_response
();
if
(
rv
==
0
)
{
if
(
downstream
->
get_request_state
()
==
Downstream
::
STREAM_CLOSED
&&
downstream
->
get_response_state
()
==
Downstream
::
MSG_COMPLETE
)
{
upstream
->
get_downstream_queue
()
->
remove
(
downstream
);
// If upstream SPDY stream was closed, we just close downstream,
// because there is no consumer now.
if
(
downstream
->
get_request_state
()
==
Downstream
::
STREAM_CLOSED
)
{
upstream
->
remove_downstream
(
downstream
);
delete
downstream
;
}
else
{
upstream
->
send
();
return
;
}
}
else
{
int
rv
=
downstream
->
parse_http_response
();
if
(
rv
!=
0
)
{
if
(
ENABLE_LOG
)
{
LOG
(
INFO
)
<<
"
<downstream> http
parser failure"
;
LOG
(
INFO
)
<<
"
Downstream HTTP
parser failure"
;
}
if
(
downstream
->
get_response_state
()
==
Downstream
::
HEADER_COMPLETE
)
{
upstream
->
rst_stream
(
downstream
,
SPDYLAY_INTERNAL_ERROR
);
...
...
@@ -291,10 +290,8 @@ void spdy_downstream_readcb(bufferevent *bev, void *ptr)
upstream
->
error_reply
(
downstream
,
502
);
}
downstream
->
set_response_state
(
Downstream
::
MSG_COMPLETE
);
upstream
->
send
();
// upstream->remove_downstream(downstream);
// delete downstream;
}
upstream
->
send
();
}
}
// namespace
...
...
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