summaryrefslogtreecommitdiffstats
path: root/httpd-2.1.10-pod.patch
blob: 8d522dc540d3f8070839cd6c06d9bd102e8ccabb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

Hack to send the dummy HTTP request only to the first listener 
configured, to avoid spamming the SSL vhost in the default install.

In 2.2 lr->protocol could be used instead to do this properly, if
that was actually initialized properly by mod_ssl.

Upstream-Status: not submitted, ugly hack which only makes a difference
		to the default configuration used in Fedora.  Need to find
		a way to do this properly.

--- httpd-2.1.10/server/mpm_common.c.pod
+++ httpd-2.1.10/server/mpm_common.c
@@ -583,6 +584,7 @@
     apr_socket_t *sock;
     apr_pool_t *p;
     apr_size_t len;
+    ap_listen_rec *lr;
 
     /* create a temporary pool for the socket.  pconf stays around too long */
     rv = apr_pool_create(&p, pod->p);
@@ -590,8 +592,11 @@
         return rv;
     }
 
-    rv = apr_socket_create(&sock, ap_listeners->bind_addr->family,
-                           SOCK_STREAM, 0, p);
+    /* Find an HTTP listener specified first in the configuration. */
+    for (lr = ap_listeners; lr->next != NULL; lr = lr->next)
+        /* noop */;
+
+    rv = apr_socket_create(&sock, lr->bind_addr->family, SOCK_STREAM, 0, p);
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf,
                      "get socket to connect to listener");
@@ -614,7 +619,7 @@
         return rv;
     }
 
-    rv = apr_socket_connect(sock, ap_listeners->bind_addr);
+    rv = apr_socket_connect(sock, lr->bind_addr);
     if (rv != APR_SUCCESS) {
         int log_level = APLOG_WARNING;
 
@@ -627,7 +632,7 @@
         }
 
         ap_log_error(APLOG_MARK, log_level, rv, ap_server_conf,
-                     "connect to listener on %pI", ap_listeners->bind_addr);
+                     "connect to listener on %pI", lr->bind_addr);
     }
 
     /* Create the request string. We include a User-Agent so that