summaryrefslogtreecommitdiffstats
path: root/server/mpm_common.c
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2000-07-11 00:08:11 +0200
committerRyan Bloom <rbb@apache.org>2000-07-11 00:08:11 +0200
commitf23ce00e31bc17b829253af460e50b02f60b7cb7 (patch)
tree375ca6de822668f9cf118bc3086a7dff1e590134 /server/mpm_common.c
parentReimplement ap_send_fd. Eliminate ap_send_fd_length. If APR_HAS_SENDFILE is (diff)
downloadapache2-f23ce00e31bc17b829253af460e50b02f60b7cb7.tar.xz
apache2-f23ce00e31bc17b829253af460e50b02f60b7cb7.zip
Move sock_disable_nagle to mpm_common.c. Rename it to ap_sock_disable_nagle.
Again, I tried to modify all MPMs that are currently using this code. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85811 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm_common.c')
-rw-r--r--server/mpm_common.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/server/mpm_common.c b/server/mpm_common.c
index 9f2923a843..d24cc11396 100644
--- a/server/mpm_common.c
+++ b/server/mpm_common.c
@@ -276,4 +276,24 @@ void ap_process_child_status(ap_proc_t *pid, ap_wait_t status)
}
}
+#if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF)
+void ap_sock_disable_nagle(int s)
+{
+ /* The Nagle algorithm says that we should delay sending partial
+ * packets in hopes of getting more data. We don't want to do
+ * this; we are not telnet. There are bad interactions between
+ * persistent connections and Nagle's algorithm that have very severe
+ * performance penalties. (Failing to disable Nagle is not much of a
+ * problem with simple HTTP.)
+ *
+ * In spite of these problems, failure here is not a shooting offense.
+ */
+ int just_say_no = 1;
+ if (ap_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)");
+ }
+}
+#endif