httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/mpm/mpmt_pthread mpmt_pthread.c
Date Fri, 23 Jun 2000 20:23:14 GMT
trawick     00/06/23 13:23:11

  Modified:    src/modules/mpm/prefork prefork.c
               src/modules/mpm/dexter dexter.c
               src/modules/mpm/mpmt_pthread mpmt_pthread.c
  Log:
  Fix a couple of problems associated with recognizing when file
  descriptors for connected sockets are too big.
  
  Todo: The BeOS MPMs seem to have the same issue.
  
  Revision  Changes    Path
  1.107     +15 -20    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.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- prefork.c	2000/06/22 22:49:50	1.106
  +++ prefork.c	2000/06/23 20:22:59	1.107
  @@ -1003,11 +1003,6 @@
   
   	SAFE_ACCEPT(accept_mutex_off());	/* unlock after "accept" */
   
  -#ifdef TPF
  -	if (csd == 0)                       /* 0 is invalid socket for TPF */
  -	    continue;
  -#endif
  -
   	/* We've got a socket, let's at least process one request off the
   	 * socket before we accept a graceful restart request.  We set
   	 * the signal to ignore because we don't want to disturb any
  @@ -1021,24 +1016,24 @@
   
           ap_get_os_sock(&sockdes, csd);
   
  -	sock_disable_nagle(sockdes);
  -
  -	iol = unix_attach_socket(csd);
  -	if (iol == NULL) {
  -	    if (errno == EBADF) {
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, NULL,
  -		    "filedescriptor (%u) larger than FD_SETSIZE (%u) "
  -		    "found, you probably need to rebuild Apache with a "
  -		    "larger FD_SETSIZE", sockdes, FD_SETSIZE);
  -	    }
  -	    else {
  -		ap_log_error(APLOG_MARK, APLOG_WARNING, errno, NULL,
  -		    "error attaching to socket");
  -	    }
  +        if (sockdes >= FD_SETSIZE) {
  +            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, NULL,
  +                         "new file descriptor %d is too large; you probably need "
  +                         "to rebuild Apache with a larger FD_SETSIZE "
  +                         "(currently %d)", 
  +                         sockdes, FD_SETSIZE);
   	    ap_close_socket(csd);
   	    continue;
  -	}
  +        }
   
  +#ifdef TPF
  +	if (sockdes == 0)                   /* 0 is invalid socket for TPF */
  +	    continue;
  +#endif
  +
  +	sock_disable_nagle(sockdes);
  +
  +	iol = unix_attach_socket(csd);
   	(void) ap_update_child_status(my_child_num, SERVER_BUSY_READ,
   				   (request_rec *) NULL);
   
  
  
  
  1.103     +9 -14     apache-2.0/src/modules/mpm/dexter/dexter.c
  
  Index: dexter.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v
  retrieving revision 1.102
  retrieving revision 1.103
  diff -u -r1.102 -r1.103
  --- dexter.c	2000/06/23 00:14:14	1.102
  +++ dexter.c	2000/06/23 20:23:02	1.103
  @@ -497,24 +497,19 @@
       if ((rv = ap_get_os_sock(&csd, sock)) != APR_SUCCESS) {
           ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL, "ap_get_os_sock");
       }
  -    sock_disable_nagle(csd);
   
  -    iol = unix_attach_socket(sock);
  -    if (iol == NULL) {
  -        if (errno == EBADF) {
  -            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, errno, NULL,
  -                "filedescriptor (%u) larger than FD_SETSIZE (%u) "
  -                "found, you probably need to rebuild Apache with a "
  -                "larger FD_SETSIZE", csd, FD_SETSIZE);
  -        }
  -        else {
  -            ap_log_error(APLOG_MARK, APLOG_WARNING, errno, NULL,
  -                "error attaching to socket");
  -        }
  +    if (csd >= FD_SETSIZE) {
  +        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, NULL,
  +                     "new file descriptor %d is too large; you probably need "
  +                     "to rebuild Apache with a larger FD_SETSIZE "
  +                     "(currently %d)", 
  +                     csd, FD_SETSIZE);
           ap_close_socket(sock);
  -	return;
  +        return;
       }
   
  +    sock_disable_nagle(csd);
  +    iol = unix_attach_socket(sock);
       conn_io = ap_bcreate(p, B_RDWR);
       ap_bpush_iol(conn_io, iol);
   
  
  
  
  1.97      +10 -14    apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
  
  Index: mpmt_pthread.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- mpmt_pthread.c	2000/06/23 20:02:58	1.96
  +++ mpmt_pthread.c	2000/06/23 20:23:08	1.97
  @@ -492,23 +492,19 @@
   
       (void) ap_get_os_sock(&csd, sock);
   
  +    if (csd >= FD_SETSIZE) {
  +        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, NULL,
  +                     "new file descriptor %d is too large; you probably need "
  +                     "to rebuild Apache with a larger FD_SETSIZE "
  +                     "(currently %d)", 
  +                     csd, FD_SETSIZE);
  +        ap_close_socket(sock);
  +        return;
  +    }
  +
       sock_disable_nagle(csd);
   
       iol = unix_attach_socket(sock);
  -    if (iol == NULL) {
  -        if (errno == EBADF) {
  -            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, NULL,
  -                "filedescriptor (%u) larger than FD_SETSIZE (%u) "
  -                "found, you probably need to rebuild Apache with a "
  -                "larger FD_SETSIZE", csd, FD_SETSIZE);
  -        }
  -        else {
  -            ap_log_error(APLOG_MARK, APLOG_WARNING, errno, NULL,
  -                "error attaching to socket");
  -        }
  -        ap_close_socket(sock);
  -	return;
  -    }
   
       (void) ap_update_child_status(my_child_num, my_thread_num,  
   				  SERVER_BUSY_READ, (request_rec *) NULL);
  
  
  

Mime
View raw message