]> granicus.if.org Git - apache/commitdiff
Win32: find_read_listeners was not correctly handling multiple listeners on the Win32...
authorBill Stoddard <stoddard@apache.org>
Sun, 29 Feb 2004 13:47:02 +0000 (13:47 +0000)
committerBill Stoddard <stoddard@apache.org>
Sun, 29 Feb 2004 13:47:02 +0000 (13:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102823 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/winnt/child.c

index 5c943a211bdb3f51c644c01d310109a8a9fba1d5..2110b68e007697a22de12b432c1a3ae75b735be8 100644 (file)
@@ -206,16 +206,21 @@ static APR_INLINE ap_listen_rec *find_ready_listener(fd_set * main_fds)
     ap_listen_rec *lr;
     SOCKET nsd;
 
-    for (lr = head_listener; lr ; lr = lr->next) {
+    lr = head_listener;
+    do {
         apr_os_sock_get(&nsd, lr->sd);
-       if (FD_ISSET(nsd, main_fds)) {
-           head_listener = lr->next;
-            if (head_listener == NULL)
+        if (FD_ISSET(nsd, main_fds)) {
+            head_listener = lr->next;
+            if (!head_listener) {
                 head_listener = ap_listeners;
-
-           return (lr);
-       }
-    }
+            }
+            return lr;
+        }
+        lr = lr->next;
+        if (!lr) {
+            lr = ap_listeners;
+        }
+    } while (lr != head_listener);
     return NULL;
 }
 
@@ -333,6 +338,8 @@ static void win9x_accept(void * dummy)
             if (listenmaxfd == INVALID_SOCKET || nsd > listenmaxfd) {
                 listenmaxfd = nsd;
             }
+            ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf,
+                         "Child %d: Listening on port %d.", my_pid, lr->bind_addr->port);
         }
     }