On Fri, Sep 27, 2013 at 4:09 AM, Ivan Zhakov <[email protected]> wrote:
> On 27 September 2013 00:08, <[email protected]> wrote: > > Author: trawick > > Date: Thu Sep 26 20:08:33 2013 > > New Revision: 1526666 > > > > URL: http://svn.apache.org/r1526666 > > Log: > > WinNT MPM: Exit the child if the parent process crashes or is terminated. > > > > Submitted by: Oracle, via trawick > > > > The original modification was made some years ago for Oracle HTTP Server > > by an Oracle employee. trawick made additional changes for style and > > for trunk/2.4.x changes. > > > [...] > > > Modified: httpd/httpd/trunk/CHANGES > > URL: > http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1526666&r1=1526665&r2=1526666&view=diff > > > ============================================================================== > > --- httpd/httpd/trunk/CHANGES [utf-8] (original) > > +++ httpd/httpd/trunk/CHANGES [utf-8] Thu Sep 26 20:08:33 2013 > > @@ -1,6 +1,9 @@ > > -*- coding: > utf-8 -*- > > Changes with Apache 2.5.0 > > > > + *) WinNT MPM: Exit the child if the parent process crashes or is > terminated. > > + [Oracle Corporation] > > + > > *) ldap: Support ldaps when using the Microsoft LDAP SDK. > > PR 54626. [Jean-Frederic Clere] > > > > > > Modified: httpd/httpd/trunk/docs/log-message-tags/next-number > > URL: > http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/log-message-tags/next-number?rev=1526666&r1=1526665&r2=1526666&view=diff > > > ============================================================================== > > --- httpd/httpd/trunk/docs/log-message-tags/next-number (original) > > +++ httpd/httpd/trunk/docs/log-message-tags/next-number Thu Sep 26 > 20:08:33 2013 > > @@ -1 +1 @@ > > -2538 > > +2539 > > > > Modified: httpd/httpd/trunk/server/mpm/winnt/child.c > > URL: > http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/child.c?rev=1526666&r1=1526665&r2=1526666&view=diff > > > ============================================================================== > > --- httpd/httpd/trunk/server/mpm/winnt/child.c (original) > > +++ httpd/httpd/trunk/server/mpm/winnt/child.c Thu Sep 26 20:08:33 2013 > > @@ -951,12 +951,12 @@ static void create_listener_thread(void) > > } > > > > > > -void child_main(apr_pool_t *pconf) > > +void child_main(apr_pool_t *pconf, DWORD parent_pid) > > { > > apr_status_t status; > > apr_hash_t *ht; > > ap_listen_rec *lr; > > - HANDLE child_events[2]; > > + HANDLE child_events[3]; > > HANDLE *child_handles; > > int listener_started = 0; > > int threads_created = 0; > > @@ -966,6 +966,7 @@ void child_main(apr_pool_t *pconf) > > DWORD tid; > > int rv; > > int i; > > + int num_events; > > > > apr_pool_create(&pchild, pconf); > > apr_pool_tag(pchild, "pchild"); > > @@ -983,6 +984,15 @@ void child_main(apr_pool_t *pconf) > > child_events[0] = exit_event; > > child_events[1] = max_requests_per_child_event; > > > > + if (parent_pid != my_pid) { > > + child_events[2] = OpenProcess(PROCESS_ALL_ACCESS, FALSE, > parent_pid); > > + num_events = 3; > This handle never closed, but it's not a big problem since it's only > one handle per process. PROCESS_ALL_ACCESS is very wide access and > child could not have required permissions if compiled on Windows Vista > [1]. It' better to request only required SYNCHRONIZE permission. > > Fixed in r1527220. Thanks a bunch! -- > Ivan Zhakov > CTO | VisualSVN | http://www.visualsvn.com > -- Born in Roswell... married an alien... http://emptyhammock.com/
