]> granicus.if.org Git - apache/commitdiff
* Add bits to use APR_TCP_DEFER_ACCEPT
authorPaul Querna <pquerna@apache.org>
Sat, 11 Dec 2004 09:53:16 +0000 (09:53 +0000)
committerPaul Querna <pquerna@apache.org>
Sat, 11 Dec 2004 09:53:16 +0000 (09:53 +0000)
* Log Warnings when adding defer accept or an accept filter fails.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111596 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/listen.c

diff --git a/CHANGES b/CHANGES
index ffc9d164f9485ff829a2e800cd64fe1fd020c4b7..d5233b10fb0ce87393ee8157ef38cdaceb5168b1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@ Changes with Apache 2.1.3
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) core: Add support for APR_TCP_DEFER_ACCEPT to defer accepting
+     of a connection until data is available.
+     [Paul Querna]
+
   *) conf: Remove AddDefaultCharset from the default configuration because
      setting a site-wide default does more harm than good. PR 23421.
      [Roy Fielding]
index 461ebc4d5b501e6a1f8c91b3525d5c0a215632b4..4ac6734f9347bf3eb3c503fedd2b2a17439bc80c 100644 (file)
@@ -164,7 +164,20 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server)
 #endif
 #endif
 #endif
-    apr_socket_accept_filter(s, ACCEPT_FILTER_NAME, "");
+    stat = apr_socket_accept_filter(s, ACCEPT_FILTER_NAME, "");
+    if (stat != APR_SUCCESS && !APR_STATUS_IS_ENOTIMPL(stat)) {
+        ap_log_perror(APLOG_MARK, APLOG_WARNING, stat, p,
+                      "Failed to enable the '%s' Accept Filter",
+                      ACCEPT_FILTER_NAME);
+    }
+#else
+#ifdef APR_TCP_DEFER_ACCEPT
+    stat = apr_socket_opt_set(s, APR_TCP_DEFER_ACCEPT, 1);   
+    if (stat != APR_SUCCESS && !APR_STATUS_IS_ENOTIMPL(stat)) {
+        ap_log_perror(APLOG_MARK, APLOG_WARNING, stat, p,
+                              "Failed to enable APR_TCP_DEFER_ACCEPT");
+    }
+#endif
 #endif
 
     server->sd = s;