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
889e705f
Commit
889e705f
authored
Apr 11, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Add logging for somewhat important events (logs, tickets, and ocsp)
parent
14d4979c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
src/shrpx.cc
src/shrpx.cc
+3
-6
src/shrpx_connection_handler.cc
src/shrpx_connection_handler.cc
+17
-10
src/shrpx_worker.cc
src/shrpx_worker.cc
+2
-6
No files found.
src/shrpx.cc
View file @
889e705f
...
...
@@ -417,9 +417,7 @@ namespace {
void
reopen_log_signal_cb
(
struct
ev_loop
*
loop
,
ev_signal
*
w
,
int
revents
)
{
auto
conn_handler
=
static_cast
<
ConnectionHandler
*>
(
w
->
data
);
if
(
LOG_ENABLED
(
INFO
))
{
LOG
(
INFO
)
<<
"Reopening log files: main"
;
}
LOG
(
NOTICE
)
<<
"Reopening log files: main"
;
(
void
)
reopen_log_files
();
redirect_stderr_to_errorlog
();
...
...
@@ -573,9 +571,8 @@ void renew_ticket_key_cb(struct ev_loop *loop, ev_timer *w, int revents) {
const
auto
&
old_ticket_keys
=
conn_handler
->
get_ticket_keys
();
auto
ticket_keys
=
std
::
make_shared
<
TicketKeys
>
();
if
(
LOG_ENABLED
(
INFO
))
{
LOG
(
INFO
)
<<
"renew ticket key"
;
}
LOG
(
NOTICE
)
<<
"Renew ticket keys: main"
;
// We store at most 2 ticket keys
if
(
old_ticket_keys
)
{
auto
&
old_keys
=
old_ticket_keys
->
keys
;
...
...
src/shrpx_connection_handler.cc
View file @
889e705f
...
...
@@ -69,6 +69,8 @@ void ocsp_cb(struct ev_loop *loop, ev_timer *w, int revent) {
return
;
}
LOG
(
NOTICE
)
<<
"Start ocsp update"
;
h
->
proceed_next_cert_ocsp
();
}
}
// namespace
...
...
@@ -358,6 +360,10 @@ int ConnectionHandler::start_ocsp_update(const char *cert_file) {
int
rv
;
int
pfd
[
2
];
if
(
LOG_ENABLED
(
INFO
))
{
LOG
(
INFO
)
<<
"Start ocsp update for "
<<
cert_file
;
}
assert
(
!
ev_is_active
(
&
ocsp_
.
rev
));
assert
(
!
ev_is_active
(
&
ocsp_
.
chldev
));
...
...
@@ -391,8 +397,8 @@ int ConnectionHandler::start_ocsp_update(const char *cert_file) {
auto
pid
=
fork
();
if
(
pid
==
-
1
)
{
auto
error
=
errno
;
LOG
(
WARN
)
<<
"Could not execute ocsp query command
: "
<<
argv
[
0
]
<<
", fork() failed, errno="
<<
error
;
LOG
(
WARN
)
<<
"Could not execute ocsp query command
for "
<<
cert_file
<<
"
: "
<<
argv
[
0
]
<<
"
, fork() failed, errno="
<<
error
;
return
-
1
;
}
...
...
@@ -461,22 +467,23 @@ void ConnectionHandler::handle_ocsp_complete() {
ev_io_stop
(
loop_
,
&
ocsp_
.
rev
);
ev_child_stop
(
loop_
,
&
ocsp_
.
chldev
);
assert
(
ocsp_
.
next
<
all_ssl_ctx_
.
size
());
auto
ssl_ctx
=
all_ssl_ctx_
[
ocsp_
.
next
];
auto
tls_ctx_data
=
static_cast
<
ssl
::
TLSContextData
*>
(
SSL_CTX_get_app_data
(
ssl_ctx
));
auto
rstatus
=
ocsp_
.
chldev
.
rstatus
;
auto
status
=
WEXITSTATUS
(
rstatus
);
if
(
ocsp_
.
error
||
!
WIFEXITED
(
rstatus
)
||
status
!=
0
)
{
LOG
(
WARN
)
<<
"ocsp query command failed: error="
<<
ocsp_
.
error
<<
", rstatus="
<<
rstatus
<<
", status="
<<
status
;
LOG
(
WARN
)
<<
"ocsp query command for "
<<
tls_ctx_data
->
cert_file
<<
" failed: error="
<<
ocsp_
.
error
<<
", rstatus="
<<
rstatus
<<
", status="
<<
status
;
++
ocsp_
.
next
;
proceed_next_cert_ocsp
();
return
;
}
assert
(
ocsp_
.
next
<
all_ssl_ctx_
.
size
());
auto
ssl_ctx
=
all_ssl_ctx_
[
ocsp_
.
next
];
auto
tls_ctx_data
=
static_cast
<
ssl
::
TLSContextData
*>
(
SSL_CTX_get_app_data
(
ssl_ctx
));
if
(
LOG_ENABLED
(
INFO
))
{
LOG
(
INFO
)
<<
"ocsp update for "
<<
tls_ctx_data
->
cert_file
<<
" finished successfully"
;
...
...
src/shrpx_worker.cc
View file @
889e705f
...
...
@@ -160,17 +160,13 @@ void Worker::process_events() {
break
;
}
case
RENEW_TICKET_KEYS
:
if
(
LOG_ENABLED
(
INFO
))
{
WLOG
(
INFO
,
this
)
<<
"Renew ticket keys: worker("
<<
this
<<
")"
;
}
WLOG
(
NOTICE
,
this
)
<<
"Renew ticket keys: worker("
<<
this
<<
")"
;
ticket_keys_
=
wev
.
ticket_keys
;
break
;
case
REOPEN_LOG
:
if
(
LOG_ENABLED
(
INFO
))
{
WLOG
(
INFO
,
this
)
<<
"Reopening log files: worker("
<<
this
<<
")"
;
}
WLOG
(
NOTICE
,
this
)
<<
"Reopening log files: worker("
<<
this
<<
")"
;
reopen_log_files
();
...
...
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