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
53604782
Commit
53604782
authored
Jan 08, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Clean up worker_event handling
parent
689e8c0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
27 deletions
+24
-27
src/shrpx_connection_handler.cc
src/shrpx_connection_handler.cc
+8
-7
src/shrpx_worker.cc
src/shrpx_worker.cc
+16
-20
No files found.
src/shrpx_connection_handler.cc
View file @
53604782
...
...
@@ -137,14 +137,15 @@ void ConnectionHandler::graceful_shutdown_worker() {
return
;
}
for
(
auto
&
worker
:
workers_
)
{
WorkerEvent
wev
;
memset
(
&
wev
,
0
,
sizeof
(
wev
));
wev
.
type
=
GRACEFUL_SHUTDOWN
;
WorkerEvent
wev
;
memset
(
&
wev
,
0
,
sizeof
(
wev
));
wev
.
type
=
GRACEFUL_SHUTDOWN
;
if
(
LOG_ENABLED
(
INFO
))
{
LLOG
(
INFO
,
this
)
<<
"Sending graceful shutdown signal to worker"
;
}
if
(
LOG_ENABLED
(
INFO
))
{
LLOG
(
INFO
,
this
)
<<
"Sending graceful shutdown signal to worker"
;
}
for
(
auto
&
worker
:
workers_
)
{
worker
->
send
(
wev
);
}
...
...
src/shrpx_worker.cc
View file @
53604782
...
...
@@ -93,7 +93,8 @@ void Worker::process_events() {
q
.
swap
(
q_
);
}
for
(
auto
&
wev
:
q
)
{
if
(
wev
.
type
==
NEW_CONNECTION
)
{
switch
(
wev
.
type
)
{
case
NEW_CONNECTION
:
{
if
(
LOG_ENABLED
(
INFO
))
{
WLOG
(
INFO
,
this
)
<<
"WorkerEvent: client_fd="
<<
wev
.
client_fd
<<
", addrlen="
<<
wev
.
client_addrlen
;
...
...
@@ -109,7 +110,7 @@ void Worker::process_events() {
close
(
wev
.
client_fd
);
continue
;
break
;
}
auto
client_handler
=
ssl
::
accept_connection
(
...
...
@@ -120,7 +121,7 @@ void Worker::process_events() {
WLOG
(
ERROR
,
this
)
<<
"ClientHandler creation failed"
;
}
close
(
wev
.
client_fd
);
continue
;
break
;
}
client_handler
->
set_http2_session
(
http2session_
.
get
());
...
...
@@ -130,10 +131,9 @@ void Worker::process_events() {
WLOG
(
INFO
,
this
)
<<
"CLIENT_HANDLER:"
<<
client_handler
<<
" created "
;
}
continue
;
break
;
}
if
(
wev
.
type
==
RENEW_TICKET_KEYS
)
{
case
RENEW_TICKET_KEYS
:
if
(
LOG_ENABLED
(
INFO
))
{
WLOG
(
INFO
,
this
)
<<
"Renew ticket keys: worker_info("
<<
worker_config
<<
")"
;
...
...
@@ -141,10 +141,8 @@ void Worker::process_events() {
worker_config
->
ticket_keys
=
wev
.
ticket_keys
;
continue
;
}
if
(
wev
.
type
==
REOPEN_LOG
)
{
break
;
case
REOPEN_LOG
:
if
(
LOG_ENABLED
(
INFO
))
{
WLOG
(
INFO
,
this
)
<<
"Reopening log files: worker_info("
<<
worker_config
<<
")"
;
...
...
@@ -152,10 +150,8 @@ void Worker::process_events() {
reopen_log_files
();
continue
;
}
if
(
wev
.
type
==
GRACEFUL_SHUTDOWN
)
{
break
;
case
GRACEFUL_SHUTDOWN
:
WLOG
(
NOTICE
,
this
)
<<
"Graceful shutdown commencing"
;
worker_config
->
graceful_shutdown
=
true
;
...
...
@@ -163,14 +159,14 @@ void Worker::process_events() {
if
(
worker_stat_
->
num_connections
==
0
)
{
ev_break
(
loop_
);
break
;
return
;
}
continue
;
}
if
(
LOG_ENABLED
(
INFO
))
{
WLOG
(
INFO
,
this
)
<<
"unknown event type "
<<
wev
.
type
;
break
;
default:
if
(
LOG_ENABLED
(
INFO
))
{
WLOG
(
INFO
,
this
)
<<
"unknown event type "
<<
wev
.
type
;
}
}
}
}
...
...
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