From f0bb3353e6638825ead34fd2d240bea016639a7f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 26 Jul 2000 14:12:38 +0000 Subject: [PATCH] Get ap_socket_disable_nagle() working again. Submitted by: Greg Ames Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85894 13f79535-47bb-0310-9956-ffa450edef68 --- include/mpm_common.h | 4 ++++ server/mpm_common.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/mpm_common.h b/include/mpm_common.h index f3d73aaedf..3a7131ed30 100644 --- a/include/mpm_common.h +++ b/include/mpm_common.h @@ -74,6 +74,10 @@ extern "C" { #endif +#ifdef HAVE_NETINET_TCP_H +#include /* for TCP_NODELAY */ +#endif + void ap_reclaim_child_processes(int terminate); void ap_wait_or_timeout(ap_wait_t *status, ap_proc_t *ret, ap_pool_t *p); void ap_process_child_status(ap_proc_t *pid, ap_wait_t status); diff --git a/server/mpm_common.c b/server/mpm_common.c index 2e1df1da9d..1028fc8dbe 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -77,6 +77,9 @@ #if HAVE_SYS_TIME_H #include /* for timeval definitions */ #endif +#if HAVE_SYS_SOCKET_H +#include /* for setsockopt prototype */ +#endif #if defined(DEXTER) || defined(MPMT_BEOS_MPM) || defined(BEOS_MPM) #define CHILD_TABLE 1 @@ -290,7 +293,7 @@ void ap_sock_disable_nagle(int s) */ int just_say_no = 1; - if (ap_setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &just_say_no, + 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, "setsockopt: (TCP_NODELAY)"); -- 2.50.1