Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 76069 invoked by uid 500); 22 Aug 2000 15:09:37 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 76040 invoked by uid 500); 22 Aug 2000 15:09:33 -0000 Delivered-To: apmail-apache-2.0-cvs@apache.org Date: 22 Aug 2000 15:09:31 -0000 Message-ID: <20000822150931.76023.qmail@locus.apache.org> From: bjh@locus.apache.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src/modules/mpm/prefork prefork.c bjh 00/08/22 08:09:28 Modified: src/include mpm_common.h src/lib/apr/include apr_network_io.h src/lib/apr/network_io/beos sockopt.c src/lib/apr/network_io/os2 sockopt.c src/lib/apr/network_io/unix sockopt.c src/lib/apr/network_io/win32 sockopt.c src/main mpm_common.c src/modules/mpm/dexter dexter.c src/modules/mpm/mpmt_pthread mpmt_pthread.c src/modules/mpm/perchild perchild.c src/modules/mpm/prefork prefork.c Log: APRize disabling nagle (setting TCP_NODELAY). Note that several areas have not been tested as they apply to MPMs or APR code that I can't test. Revision Changes Path 1.10 +1 -1 apache-2.0/src/include/mpm_common.h Index: mpm_common.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/mpm_common.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mpm_common.h 2000/08/06 06:07:01 1.9 +++ mpm_common.h 2000/08/22 15:09:17 1.10 @@ -123,7 +123,7 @@ * Nagle's algorithm that have severe performance penalties. * @param s The socket to disable nagle for. */ -void ap_sock_disable_nagle(int s); +void ap_sock_disable_nagle(apr_socket_t *s); #else #define ap_sock_disable_nagle(s) /* NOOP */ #endif 1.53 +1 -0 apache-2.0/src/lib/apr/include/apr_network_io.h Index: apr_network_io.h =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_network_io.h,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- apr_network_io.h 2000/08/06 06:07:09 1.52 +++ apr_network_io.h 2000/08/22 15:09:20 1.53 @@ -92,6 +92,7 @@ #define APR_SO_SNDBUF 64 #define APR_SO_RCVBUF 128 #define APR_SO_DISCONNECTED 256 +#define APR_TCP_NODELAY 512 #define APR_POLLIN 0x001 #define APR_POLLPRI 0x002 1.23 +6 -1 apache-2.0/src/lib/apr/network_io/beos/sockopt.c Index: sockopt.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/beos/sockopt.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- sockopt.c 2000/08/02 05:26:26 1.22 +++ sockopt.c 2000/08/22 15:09:21 1.23 @@ -107,6 +107,11 @@ sock->timeout = on; } + if (opt & APR_TCP_NODELAY) { + if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + return errno; + } + } return APR_SUCCESS; } @@ -149,4 +154,4 @@ /* on BeOS h_errno is a global... */ return h_errno; } -#endif \ No newline at end of file +#endif 1.17 +5 -0 apache-2.0/src/lib/apr/network_io/os2/sockopt.c Index: sockopt.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/os2/sockopt.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- sockopt.c 2000/08/06 16:35:54 1.16 +++ sockopt.c 2000/08/22 15:09:22 1.17 @@ -114,6 +114,11 @@ if (opt & APR_SO_TIMEOUT) { sock->timeout = on; } + if (opt & APR_TCP_NODELAY) { + if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + return APR_OS2_STATUS(sock_errno()); + } + } return APR_SUCCESS; } 1.33 +5 -0 apache-2.0/src/lib/apr/network_io/unix/sockopt.c Index: sockopt.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockopt.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- sockopt.c 2000/08/02 05:26:29 1.32 +++ sockopt.c 2000/08/22 15:09:23 1.33 @@ -170,6 +170,11 @@ } sock->timeout = on; } + if (opt & APR_TCP_NODELAY) { + if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + return errno; + } + } return APR_SUCCESS; } 1.25 +5 -0 apache-2.0/src/lib/apr/network_io/win32/sockopt.c Index: sockopt.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/sockopt.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- sockopt.c 2000/08/17 20:26:29 1.24 +++ sockopt.c 2000/08/22 15:09:24 1.25 @@ -157,6 +157,11 @@ } break; } + case APR_TCP_NODELAY: + if (setsockopt(sock->sock, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + return WSAGetLastError(); + } + break; default: return APR_EINVAL; break; 1.33 +4 -5 apache-2.0/src/main/mpm_common.c Index: mpm_common.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/mpm_common.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- mpm_common.c 2000/08/06 06:07:35 1.32 +++ mpm_common.c 2000/08/22 15:09:24 1.33 @@ -261,7 +261,7 @@ } #if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF) -void ap_sock_disable_nagle(int s) +void ap_sock_disable_nagle(apr_socket_t *s) { /* The Nagle algorithm says that we should delay sending partial * packets in hopes of getting more data. We don't want to do @@ -272,11 +272,10 @@ * * In spite of these problems, failure here is not a shooting offense. */ - int just_say_no = 1; + apr_status_t status = apr_setsocketopt(s, APR_TCP_NODELAY, 1); - if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &just_say_no, - sizeof(int)) != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, + if (status != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_WARNING, status, ap_server_conf, "setsockopt: (TCP_NODELAY)"); } } 1.124 +1 -1 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.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- dexter.c 2000/08/06 06:07:39 1.123 +++ dexter.c 2000/08/22 15:09:25 1.124 @@ -416,7 +416,7 @@ return; } - ap_sock_disable_nagle(csd); + ap_sock_disable_nagle(sock); iol = ap_iol_attach_socket(p, sock); conn_io = ap_bcreate(p, B_RDWR); ap_bpush_iol(conn_io, iol); 1.119 +1 -1 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.118 retrieving revision 1.119 diff -u -r1.118 -r1.119 --- mpmt_pthread.c 2000/08/06 06:07:40 1.118 +++ mpmt_pthread.c 2000/08/22 15:09:26 1.119 @@ -411,7 +411,7 @@ return; } - ap_sock_disable_nagle(csd); + ap_sock_disable_nagle(sock); iol = ap_iol_attach_socket(p, sock); 1.19 +1 -1 apache-2.0/src/modules/mpm/perchild/perchild.c Index: perchild.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/mpm/perchild/perchild.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- perchild.c 2000/08/06 21:17:33 1.18 +++ perchild.c 2000/08/22 15:09:27 1.19 @@ -453,7 +453,7 @@ } if (thread_socket_table[thread_num] < 0) { - ap_sock_disable_nagle(csd); + ap_sock_disable_nagle(sock); } iol = ap_iol_attach_socket(p, sock); conn_io = ap_bcreate(p, B_RDWR); 1.126 +1 -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.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- prefork.c 2000/08/06 06:07:42 1.125 +++ prefork.c 2000/08/22 15:09:28 1.126 @@ -1020,7 +1020,7 @@ continue; #endif - ap_sock_disable_nagle(sockdes); + ap_sock_disable_nagle(csd); iol = ap_iol_attach_socket(ptrans, csd); (void) ap_update_child_status(my_child_num, SERVER_BUSY_READ,