diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2015-10-24 10:34:40 +0200 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2015-10-24 10:34:40 +0200 |
commit | f775596dea7222b55efc18005acf1919609c3602 (patch) | |
tree | 9a0937e781142c443fe1331a39dac5d5f91fb74e /server/mpm/winnt/mpm_winnt.c | |
parent | 48802c25dc82a8b13ac351c0c2137ef748256bbd (diff) | |
download | apache2-f775596dea7222b55efc18005acf1919609c3602.tar.gz |
Imported Upstream version 2.4.17
Diffstat (limited to 'server/mpm/winnt/mpm_winnt.c')
-rw-r--r-- | server/mpm/winnt/mpm_winnt.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 957af639..853c38b8 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -360,6 +360,13 @@ static int send_handles_to_child(apr_pool_t *p, HANDLE hScore; apr_size_t BytesWritten; + if ((rv = apr_file_write_full(child_in, &my_generation, + sizeof(my_generation), NULL)) + != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO(02964) + "Parent: Unable to send its generation to the child"); + return -1; + } if (!DuplicateHandle(hCurrentProcess, child_ready_event, hProcess, &hDup, EVENT_MODIFY_STATE | SYNCHRONIZE, FALSE, 0)) { ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00392) @@ -1037,6 +1044,7 @@ static void winnt_rewrite_args(process_rec *process) { HANDLE filehand; HANDLE hproc = GetCurrentProcess(); + DWORD BytesRead; /* This is the child */ my_pid = GetCurrentProcessId(); @@ -1074,6 +1082,16 @@ static void winnt_rewrite_args(process_rec *process) * already */ + /* Read this child's generation number as soon as now, + * so that further hooks can query it. + */ + if (!ReadFile(pipe, &my_generation, sizeof(my_generation), + &BytesRead, (LPOVERLAPPED) NULL) + || (BytesRead != sizeof(my_generation))) { + ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), NULL, APLOGNO(02965) + "Child: Unable to retrieve my generation from the parent"); + exit(APEXIT_CHILDINIT); + } /* The parent is responsible for providing the * COMPLETE ARGUMENTS REQUIRED to the child. @@ -1665,8 +1683,6 @@ static void winnt_child_init(apr_pool_t *pchild, struct server_rec *s) /* Done reading from the parent, close that channel */ CloseHandle(pipe); - - my_generation = ap_scoreboard_image->global->running_generation; } else { /* Single process mode - this lock doesn't even need to exist */ @@ -1723,6 +1739,7 @@ static int winnt_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s ) ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, APLOGNO(00456) "Server built: %s", ap_get_server_built()); ap_log_command_line(plog, s); + ap_log_mpm_common(s); restart = master_main(ap_server_conf, shutdown_event, restart_event); |