You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2017/03/28 20:58:43 UTC

svn commit: r1789215 - in /httpd/httpd/branches/2.4.x: CHANGES server/listen.c

Author: ylavic
Date: Tue Mar 28 20:58:42 2017
New Revision: 1789215

URL: http://svn.apache.org/viewvc?rev=1789215&view=rev
Log:
Revert r1789213 and r1789214: wrong branch...

Modified:
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/server/listen.c

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1789215&r1=1789214&r2=1789215&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Tue Mar 28 20:58:42 2017
@@ -2,11 +2,6 @@
 
 Changes with Apache 2.4.26
 
-  *) core: Disallow multiple Listen on the same IP:port when listener buckets
-     are configured (ListenCoresBucketsRatio > 0), consistently with the single
-     bucket case (default), thus avoiding the leak of the corresponding socket
-     descriptors on graceful restart.  [Yann Ylavic]
-
   *) mod_cache: Fix a regression in 2.4.25 for the forward proxy case by
      computing and using the same entity key according to when the cache
      checks, loads and saves the request.

Modified: httpd/httpd/branches/2.4.x/server/listen.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/listen.c?rev=1789215&r1=1789214&r2=1789215&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/listen.c (original)
+++ httpd/httpd/branches/2.4.x/server/listen.c Tue Mar 28 20:58:42 2017
@@ -277,14 +277,18 @@ static apr_status_t close_listeners_on_e
     return APR_SUCCESS;
 }
 
-static int find_listeners(ap_listen_rec **from, ap_listen_rec **to,
-                          const char *addr, apr_port_t port)
+static const char *alloc_listener(process_rec *process, char *addr,
+                                  apr_port_t port, const char* proto,
+                                  void *slave)
 {
-    int found = 0;
-
-    while (*from) {
-        apr_sockaddr_t *sa = (*from)->bind_addr;
+    ap_listen_rec **walk, *last;
+    apr_status_t status;
+    apr_sockaddr_t *sa;
+    int found_listener = 0;
 
+    /* see if we've got an old listener for this address:port */
+    for (walk = &old_listeners; *walk;) {
+        sa = (*walk)->bind_addr;
         /* Some listeners are not real so they will not have a bind_addr. */
         if (sa) {
             ap_listen_rec *new;
@@ -297,39 +301,19 @@ static int find_listeners(ap_listen_rec
             if (port == oldport &&
                 ((!addr && !sa->hostname) ||
                  ((addr && sa->hostname) && !strcmp(sa->hostname, addr)))) {
-                found = 1;
-                if (!to) {
-                    break;
-                }
-                new = *from;
-                *from = new->next;
-                new->next = *to;
-                *to = new;
+                new = *walk;
+                *walk = new->next;
+                new->next = ap_listeners;
+                ap_listeners = new;
+                found_listener = 1;
                 continue;
             }
         }
 
-        from = &(*from)->next;
+        walk = &(*walk)->next;
     }
 
-    return found;
-}
-
-static const char *alloc_listener(process_rec *process, const char *addr,
-                                  apr_port_t port, const char* proto,
-                                  void *slave)
-{
-    ap_listen_rec *last;
-    apr_status_t status;
-    apr_sockaddr_t *sa;
-
-    /* see if we've got a listener for this address:port, which is an error */
-    if (find_listeners(&ap_listeners, NULL, addr, port)) {
-        return "Cannot define multiple Listeners on the same IP:port";
-    }
-
-    /* see if we've got an old listener for this address:port */
-    if (find_listeners(&old_listeners, &ap_listeners, addr, port)) {
+    if (found_listener) {
         if (ap_listeners->slave != slave) {
             return "Cannot define a slave on the same IP:port as a Listener";
         }