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
d0bf2474
Commit
d0bf2474
authored
Jun 04, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Refactor graceful shutdown in Http2Upstream
Instead of using bool flag, just stop prepare watcher.
parent
9237d30e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+15
-15
src/shrpx_http2_upstream.h
src/shrpx_http2_upstream.h
+0
-1
No files found.
src/shrpx_http2_upstream.cc
View file @
d0bf2474
...
...
@@ -787,23 +787,25 @@ void Http2Upstream::submit_goaway() {
void
Http2Upstream
::
check_shutdown
()
{
int
rv
;
if
(
shutdown_handled_
)
{
auto
worker
=
handler_
->
get_worker
();
if
(
!
worker
->
get_graceful_shutdown
())
{
return
;
}
auto
worker
=
handler_
->
get_worker
(
);
ev_prepare_stop
(
handler_
->
get_loop
(),
&
prep_
);
if
(
worker
->
get_graceful_shutdown
())
{
shutdown_handled_
=
true
;
rv
=
nghttp2_submit_shutdown_notice
(
session_
);
if
(
rv
!=
0
)
{
ULOG
(
FATAL
,
this
)
<<
"nghttp2_submit_shutdown_notice() failed: "
<<
nghttp2_strerror
(
rv
);
return
;
}
handler_
->
signal_write
();
ev_timer_start
(
handler_
->
get_loop
(),
&
shutdown_timer_
);
rv
=
nghttp2_submit_shutdown_notice
(
session_
);
if
(
rv
!=
0
)
{
ULOG
(
FATAL
,
this
)
<<
"nghttp2_submit_shutdown_notice() failed: "
<<
nghttp2_strerror
(
rv
);
return
;
}
handler_
->
signal_write
();
ev_timer_start
(
handler_
->
get_loop
(),
&
shutdown_timer_
);
}
nghttp2_session_callbacks
*
create_http2_upstream_callbacks
()
{
...
...
@@ -870,9 +872,7 @@ Http2Upstream::Http2Upstream(ClientHandler *handler)
downstream_queue_
(
downstream_queue_size
(
handler
->
get_worker
()),
!
get_config
()
->
http2_proxy
),
handler_
(
handler
),
session_
(
nullptr
),
shutdown_handled_
(
false
)
{
session_
(
nullptr
)
{
int
rv
;
auto
&
http2conf
=
get_config
()
->
http2
;
...
...
src/shrpx_http2_upstream.h
View file @
d0bf2474
...
...
@@ -132,7 +132,6 @@ private:
ClientHandler
*
handler_
;
nghttp2_session
*
session_
;
bool
flow_control_
;
bool
shutdown_handled_
;
};
nghttp2_session_callbacks
*
create_http2_upstream_callbacks
();
...
...
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