httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/mpm/prefork prefork.c
Date Thu, 13 Jul 2000 09:17:53 GMT
gstein      00/07/13 02:17:51

  Modified:    src/modules/mpm/prefork prefork.c
  Log:
  reverse the setup_listeners() change from a few days ago. it broke prefork
      by not getting listenmaxfd set, nor listenfds.
  
  Revision  Changes    Path
  1.118     +24 -1     apache-2.0/src/modules/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- prefork.c	2000/07/11 22:12:17	1.117
  +++ prefork.c	2000/07/13 09:17:46	1.118
  @@ -1257,6 +1257,29 @@
       }
   }
   
  +static int setup_listeners(server_rec *s)
  +{
  +    ap_listen_rec *lr;
  +    int sockdes;
  +
  +    if (ap_listen_open(s->process, s->port)) {
  +	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, 0, s,
  +		    "no listening sockets available, shutting down");
  +	return -1;
  +    }
  +
  +    listenmaxfd = -1;
  +    FD_ZERO(&listenfds);
  +    for (lr = ap_listeners; lr; lr = lr->next) {
  +        ap_get_os_sock(&sockdes, lr->sd);
  +	FD_SET(sockdes, &listenfds);
  +	if (sockdes > listenmaxfd) {
  +	    listenmaxfd = sockdes;
  +	}
  +    }
  +    return 0;
  +}
  +
   /* Useful to erase the status of children that might be from previous
    * generations */
   static void ap_prefork_force_reset_connection_status(long conn_id)
  @@ -1288,7 +1311,7 @@
    
       ap_log_pid(pconf, ap_pid_fname);
   
  -    if (ap_setup_listeners(s)) {
  +    if (setup_listeners(s)) {
   	/* XXX: hey, what's the right way for the mpm to indicate a fatal error? */
   	return 1;
       }
  
  
  

Mime
View raw message