Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
8942a4cd
Commit
8942a4cd
authored
Jun 21, 2011
by
valenok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignoring SIGCHLD to let OS reap the zombies.
parent
9e524a2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
mongoose.c
mongoose.c
+2
-3
mongoose.h
mongoose.h
+5
-0
No files found.
mongoose.c
View file @
8942a4cd
...
@@ -2993,9 +2993,6 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
...
@@ -2993,9 +2993,6 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
done:
done:
if
(
pid
!=
(
pid_t
)
-
1
)
{
if
(
pid
!=
(
pid_t
)
-
1
)
{
kill
(
pid
,
SIGKILL
);
kill
(
pid
,
SIGKILL
);
#if !defined(_WIN32)
do
{}
while
(
waitpid
(
-
1
,
&
i
,
WNOHANG
)
>
0
);
#endif
}
}
if
(
fd_stdin
[
0
]
!=
-
1
)
{
if
(
fd_stdin
[
0
]
!=
-
1
)
{
(
void
)
close
(
fd_stdin
[
0
]);
(
void
)
close
(
fd_stdin
[
0
]);
...
@@ -4133,6 +4130,8 @@ struct mg_context *mg_start(mg_callback_t user_callback, void *user_data,
...
@@ -4133,6 +4130,8 @@ struct mg_context *mg_start(mg_callback_t user_callback, void *user_data,
// Ignore SIGPIPE signal, so if browser cancels the request, it
// Ignore SIGPIPE signal, so if browser cancels the request, it
// won't kill the whole process.
// won't kill the whole process.
(
void
)
signal
(
SIGPIPE
,
SIG_IGN
);
(
void
)
signal
(
SIGPIPE
,
SIG_IGN
);
// Also ignoring SIGCHLD to let the OS to reap zombies properly.
(
void
)
signal
(
SIGCHLD
,
SIG_IGN
);
#endif // !_WIN32
#endif // !_WIN32
(
void
)
pthread_mutex_init
(
&
ctx
->
mutex
,
NULL
);
(
void
)
pthread_mutex_init
(
&
ctx
->
mutex
,
NULL
);
...
...
mongoose.h
View file @
8942a4cd
...
@@ -88,6 +88,11 @@ typedef void * (*mg_callback_t)(enum mg_event event,
...
@@ -88,6 +88,11 @@ typedef void * (*mg_callback_t)(enum mg_event event,
// options: NULL terminated list of option_name, option_value pairs that
// options: NULL terminated list of option_name, option_value pairs that
// specify Mongoose configuration parameters.
// specify Mongoose configuration parameters.
//
//
// Side-effects: on UNIX, ignores SIGCHLD and SIGPIPE signals. If custom
// processing is required for these, signal handlers must be set up
// after calling mg_start().
//
//
// Example:
// Example:
// const char *options[] = {
// const char *options[] = {
// "document_root", "/var/www",
// "document_root", "/var/www",
...
...
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