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
c44587a7
Commit
c44587a7
authored
Sep 24, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Use _Exit when exiting from child process
parent
938fa9a1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
12 deletions
+16
-12
src/shrpx.cc
src/shrpx.cc
+8
-6
src/shrpx.h
src/shrpx.h
+1
-1
src/shrpx_connection_handler.cc
src/shrpx_connection_handler.cc
+3
-3
src/shrpx_ssl.cc
src/shrpx_ssl.cc
+4
-2
No files found.
src/shrpx.cc
View file @
c44587a7
...
...
@@ -244,6 +244,8 @@ void exec_binary(SignalServer *ssv) {
return
;
}
// child process
shrpx_signal_unset_master_proc_ign_handler
();
rv
=
shrpx_signal_unblock_all
();
...
...
@@ -251,7 +253,7 @@ void exec_binary(SignalServer *ssv) {
auto
error
=
errno
;
LOG
(
ERROR
)
<<
"Unblocking all signals failed: "
<<
strerror
(
error
);
e
xit
(
EXIT_FAILURE
);
_E
xit
(
EXIT_FAILURE
);
}
auto
exec_path
=
util
::
get_exec_path
(
get_config
()
->
argc
,
get_config
()
->
argv
,
...
...
@@ -259,7 +261,7 @@ void exec_binary(SignalServer *ssv) {
if
(
!
exec_path
)
{
LOG
(
ERROR
)
<<
"Could not resolve the executable path"
;
e
xit
(
EXIT_FAILURE
);
_E
xit
(
EXIT_FAILURE
);
}
auto
argv
=
make_unique
<
char
*
[]
>
(
get_config
()
->
argc
+
1
);
...
...
@@ -336,7 +338,7 @@ void exec_binary(SignalServer *ssv) {
if
(
execve
(
argv
[
0
],
argv
.
get
(),
envp
.
get
())
==
-
1
)
{
auto
error
=
errno
;
LOG
(
ERROR
)
<<
"execve failed: errno="
<<
error
;
e
xit
(
EXIT_FAILURE
);
_E
xit
(
EXIT_FAILURE
);
}
}
}
// namespace
...
...
@@ -699,7 +701,7 @@ pid_t fork_worker_process(SignalServer *ssv) {
auto
error
=
errno
;
LOG
(
FATAL
)
<<
"Unblocking all signals failed: "
<<
strerror
(
error
);
e
xit
(
EXIT_FAILURE
);
_E
xit
(
EXIT_FAILURE
);
}
close
(
ssv
->
ipc_fd
[
1
]);
...
...
@@ -708,10 +710,10 @@ pid_t fork_worker_process(SignalServer *ssv) {
if
(
rv
!=
0
)
{
LOG
(
FATAL
)
<<
"Worker process returned error"
;
e
xit
(
EXIT_FAILURE
);
_E
xit
(
EXIT_FAILURE
);
}
e
xit
(
EXIT_SUCCESS
);
_E
xit
(
EXIT_SUCCESS
);
}
// parent process
...
...
src/shrpx.h
View file @
c44587a7
...
...
@@ -42,6 +42,6 @@
#define _Exit(status) _exit(status)
#endif // !HAVE__EXIT
#define DIE()
e
xit(EXIT_FAILURE)
#define DIE()
_E
xit(EXIT_FAILURE)
#endif // SHRPX_H
src/shrpx_connection_handler.cc
View file @
c44587a7
...
...
@@ -454,7 +454,7 @@ int ConnectionHandler::start_ocsp_update(const char *cert_file) {
auto
error
=
errno
;
LOG
(
FATAL
)
<<
"Unblocking all signals failed: "
<<
strerror
(
error
);
e
xit
(
EXIT_FAILURE
);
_E
xit
(
EXIT_FAILURE
);
}
dup2
(
pfd
[
1
],
1
);
...
...
@@ -465,7 +465,7 @@ int ConnectionHandler::start_ocsp_update(const char *cert_file) {
auto
error
=
errno
;
LOG
(
ERROR
)
<<
"Could not execute ocsp query command: "
<<
argv
[
0
]
<<
", execve() faild, errno="
<<
error
;
e
xit
(
EXIT_FAILURE
);
_E
xit
(
EXIT_FAILURE
);
}
// unreachable
}
...
...
@@ -482,7 +482,7 @@ int ConnectionHandler::start_ocsp_update(const char *cert_file) {
auto
error
=
errno
;
LOG
(
FATAL
)
<<
"Restoring all signals failed: "
<<
strerror
(
error
);
e
xit
(
EXIT_FAILURE
);
_E
xit
(
EXIT_FAILURE
);
}
if
(
pid
==
-
1
)
{
...
...
src/shrpx_ssl.cc
View file @
c44587a7
...
...
@@ -88,6 +88,8 @@ int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) {
}
}
// namespace
// This function is meant be called from master process, hence the
// call exit(3).
std
::
vector
<
unsigned
char
>
set_alpn_prefs
(
const
std
::
vector
<
std
::
string
>
&
protos
)
{
size_t
len
=
0
;
...
...
@@ -95,7 +97,7 @@ set_alpn_prefs(const std::vector<std::string> &protos) {
for
(
const
auto
&
proto
:
protos
)
{
if
(
proto
.
size
()
>
255
)
{
LOG
(
FATAL
)
<<
"Too long ALPN identifier: "
<<
proto
.
size
();
DIE
(
);
exit
(
EXIT_FAILURE
);
}
len
+=
1
+
proto
.
size
();
...
...
@@ -103,7 +105,7 @@ set_alpn_prefs(const std::vector<std::string> &protos) {
if
(
len
>
(
1
<<
16
)
-
1
)
{
LOG
(
FATAL
)
<<
"Too long ALPN identifier list: "
<<
len
;
DIE
(
);
exit
(
EXIT_FAILURE
);
}
auto
out
=
std
::
vector
<
unsigned
char
>
(
len
);
...
...
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