You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2001/07/10 20:56:59 UTC

cvs commit: httpd-2.0/server/mpm/prefork prefork.c

trawick     01/07/10 11:56:59

  Modified:    server/mpm/prefork prefork.c
  Log:
  Check the pod after processing a connection so that we'll go away
  if a graceful restart occurred while we were processing the
  connection.  Otherwise, we won't wake up until a real connection
  comes in and we'll use the wrong config to process it and we may
  block in the wrong syscall (because the new generation is using a
  different accept mutex) and in general it is goofy.
  
  Revision  Changes    Path
  1.189     +10 -14    httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.188
  retrieving revision 1.189
  diff -u -r1.188 -r1.189
  --- prefork.c	2001/06/27 17:43:39	1.188
  +++ prefork.c	2001/07/10 18:56:55	1.189
  @@ -670,18 +670,7 @@
   	     */
   	    for (;;) {
                   ap_sync_scoreboard_image();
  -		if (die_now) {
  -		    /* we didn't get a socket, and we were told to die */
  -		    clean_child_exit(0);
  -		}
   		stat = apr_accept(&csd, sd, ptrans);
  -                /* In reality, this could be done later, but to keep it
  -                 * consistent with MPMs that have a thread race-condition,
  -                 * we will do it here.
  -                 */
  -                if (!ap_mpm_pod_check(pod)) {
  -                    die_now = 1;
  -                }
   		if (stat == APR_SUCCESS || !APR_STATUS_IS_EINTR(stat))
   		    break;
   	    }
  @@ -785,9 +774,6 @@
   	    }
   
               ap_sync_scoreboard_image();
  -	    if (die_now) {
  -		clean_child_exit(0);
  -	    }
   	}
   
   	SAFE_ACCEPT(accept_mutex_off());	/* unlock after "accept" */
  @@ -826,6 +812,16 @@
               ap_lingering_close(current_conn);
           }
           
  +        /* Check the pod after processing a connection so that we'll go away
  +         * if a graceful restart occurred while we were processing the 
  +         * connection.  Otherwise, we won't wake up until a real connection 
  +         * comes in and we'll use the wrong config to process it and we may
  +         * block in the wrong syscall (because the new generation is using a
  +         * different accept mutex) and in general it is goofy.
  +         */
  +        if (!ap_mpm_pod_check(pod)) {
  +            die_now = 1;
  +        }
           ap_sync_scoreboard_image();
       }
       clean_child_exit(0);