-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,59 @@ | ||
diff --color -Naur old/server.c new/server.c | ||
--- old/lighttpd1.4-lighttpd-1.4.56/src/server.c 2020-11-30 05:31:14.000000000 +0800 | ||
+++ new/lighttpd1.4-lighttpd-1.4.56/src/server.c 2022-02-02 15:17:33.789539164 +0800 | ||
@@ -1547,6 +1547,7 @@ | ||
+++ new/lighttpd1.4-lighttpd-1.4.56/src/server.c 2022-02-20 18:48:35.802869303 +0800 | ||
@@ -1165,7 +1165,7 @@ | ||
return -1; | ||
} | ||
} | ||
- | ||
+#if 0 | ||
/* close stdin and stdout, as they are not needed */ | ||
{ | ||
struct stat st; | ||
@@ -1198,7 +1198,7 @@ | ||
if (devnull != errfd) close(devnull); | ||
#endif | ||
} | ||
- | ||
+#endif | ||
http_response_send_1xx_cb_set(NULL, HTTP_VERSION_2); | ||
if (srv->srvconf.feature_flags | ||
&& !config_plugin_value_tobool( | ||
@@ -1529,7 +1529,7 @@ | ||
log_error(srv->errh, __FILE__, __LINE__, | ||
"server idle time limit command line option disables server.max-worker config file option."); | ||
} | ||
- | ||
+int lighty_worker_index = -1; | ||
/* start watcher and workers */ | ||
num_childs = srv->srvconf.max_worker; | ||
if (num_childs > 0) { | ||
@@ -1542,10 +1542,12 @@ | ||
server_graceful_signal_prev_generation(); | ||
while (!child && !srv_shutdown && !graceful_shutdown) { | ||
if (num_childs > 0) { | ||
+ lighty_worker_index++; | ||
switch ((pid = fork())) { | ||
case -1: | ||
return -1; | ||
case 0: | ||
+ init_worker(lighty_worker_index); | ||
child = 1; | ||
+ init_worker(getpid()); | ||
alarm(0); | ||
break; | ||
default: | ||
@@ -1904,7 +1905,7 @@ | ||
@@ -1904,7 +1906,7 @@ | ||
} | ||
|
||
connections * const joblist = connection_joblist; | ||
- | ||
+batch_start(); | ||
if (fdevent_poll(srv->ev, joblist->used ? 0 : 1000) > 0) { | ||
last_active_ts = log_epoch_secs; | ||
} | ||
@@ -1914,6 +1915,7 @@ | ||
@@ -1914,6 +1916,7 @@ | ||
: &srv->joblist_A; | ||
|
||
server_run_con_queue(joblist); | ||
+batch_flush(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters