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
faee23a9
Commit
faee23a9
authored
Jun 06, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed assertion failure. Resume downstream read on SPDY stream close.
parent
4ac68952
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
5 deletions
+25
-5
examples/shrpx_downstream.cc
examples/shrpx_downstream.cc
+11
-5
examples/shrpx_downstream.h
examples/shrpx_downstream.h
+1
-0
examples/shrpx_io_control.cc
examples/shrpx_io_control.cc
+6
-0
examples/shrpx_io_control.h
examples/shrpx_io_control.h
+2
-0
examples/shrpx_spdy_upstream.cc
examples/shrpx_spdy_upstream.cc
+5
-0
No files found.
examples/shrpx_downstream.cc
View file @
faee23a9
...
...
@@ -87,6 +87,11 @@ bool Downstream::resume_read(IOCtrlReason reason)
return
ioctrl_
.
resume_read
(
reason
);
}
void
Downstream
::
force_resume_read
()
{
ioctrl_
.
force_resume_read
();
}
namespace
{
void
check_transfer_encoding_chunked
(
bool
*
chunked
,
const
Headers
::
value_type
&
item
)
...
...
@@ -416,12 +421,13 @@ void body_buf_cb(evbuffer *body, size_t oldlen, size_t newlen, void *arg)
int
Downstream
::
init_response_body_buf
()
{
assert
(
response_body_buf_
==
0
);
response_body_buf_
=
evbuffer_new
();
if
(
response_body_buf_
==
0
)
{
DIE
();
if
(
!
response_body_buf_
)
{
response_body_buf_
=
evbuffer_new
();
if
(
response_body_buf_
==
0
)
{
DIE
();
}
evbuffer_setcb
(
response_body_buf_
,
body_buf_cb
,
this
);
}
evbuffer_setcb
(
response_body_buf_
,
body_buf_cb
,
this
);
return
0
;
}
...
...
examples/shrpx_downstream.h
View file @
faee23a9
...
...
@@ -56,6 +56,7 @@ public:
int32_t
get_stream_id
()
const
;
void
pause_read
(
IOCtrlReason
reason
);
bool
resume_read
(
IOCtrlReason
reason
);
void
force_resume_read
();
// downstream request API
const
Headers
&
get_request_headers
()
const
;
void
add_request_header
(
const
std
::
string
&
name
,
const
std
::
string
&
value
);
...
...
examples/shrpx_io_control.cc
View file @
faee23a9
...
...
@@ -58,4 +58,10 @@ bool IOControl::resume_read(IOCtrlReason reason)
}
}
void
IOControl
::
force_resume_read
()
{
std
::
fill
(
ctrlv_
.
begin
(),
ctrlv_
.
end
(),
0
);
bufferevent_enable
(
bev_
,
EV_READ
);
}
}
// namespace shrpx
examples/shrpx_io_control.h
View file @
faee23a9
...
...
@@ -48,6 +48,8 @@ public:
void
pause_read
(
IOCtrlReason
reason
);
// Returns true if read operation is enabled after this call
bool
resume_read
(
IOCtrlReason
reason
);
// Clear all pause flags and enable read
void
force_resume_read
();
private:
bufferevent
*
bev_
;
std
::
vector
<
int
>
ctrlv_
;
...
...
examples/shrpx_spdy_upstream.cc
View file @
faee23a9
...
...
@@ -103,6 +103,11 @@ void on_stream_close_callback
if
(
downstream
->
get_response_state
()
==
Downstream
::
MSG_COMPLETE
)
{
upstream
->
get_downstream_queue
()
->
remove
(
downstream
);
delete
downstream
;
}
else
{
// At this point, downstream read may be paused. To reclaim
// file descriptor, enable read here and catch read
// notification. And delete downstream there.
downstream
->
force_resume_read
();
}
}
}
...
...
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