]>
Commit | Line | Data |
---|---|---|
d9bb6656 AM |
1 | diff -urp httpd-2.2.24.org/server/mpm_common.c httpd-2.2.24/server/mpm_common.c |
2 | --- httpd-2.2.24.org/server/mpm_common.c 2013-02-16 23:51:16.000000000 +0100 | |
3 | +++ httpd-2.2.24/server/mpm_common.c 2013-04-10 21:25:06.322056566 +0200 | |
4 | @@ -648,6 +648,7 @@ static apr_status_t dummy_connection(ap_ | |
a0dc379f AM |
5 | apr_socket_t *sock; |
6 | apr_pool_t *p; | |
7 | apr_size_t len; | |
8 | + ap_listen_rec *lp; | |
9 | ||
10 | /* create a temporary pool for the socket. pconf stays around too long */ | |
11 | rv = apr_pool_create(&p, pod->p); | |
d9bb6656 | 12 | @@ -655,8 +656,19 @@ static apr_status_t dummy_connection(ap_ |
a0dc379f AM |
13 | return rv; |
14 | } | |
15 | ||
16 | - rv = apr_socket_create(&sock, ap_listeners->bind_addr->family, | |
17 | - SOCK_STREAM, 0, p); | |
18 | + /* If possible, find a listener which is configured for | |
19 | + * plain-HTTP, not SSL; using an SSL port would either be | |
20 | + * expensive to do correctly (performing a complete SSL handshake) | |
21 | + * or cause log spam by doing incorrectly (simply sending EOF). */ | |
22 | + lp = ap_listeners; | |
23 | + while (lp && lp->protocol && strcasecmp(lp->protocol, "http") != 0) { | |
24 | + lp = lp->next; | |
25 | + } | |
26 | + if (!lp) { | |
27 | + lp = ap_listeners; | |
28 | + } | |
29 | + | |
30 | + rv = apr_socket_create(&sock, lp->bind_addr->family, SOCK_STREAM, 0, p); | |
31 | if (rv != APR_SUCCESS) { | |
32 | ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, | |
33 | "get socket to connect to listener"); | |
d9bb6656 | 34 | @@ -679,7 +691,7 @@ static apr_status_t dummy_connection(ap_ |
a0dc379f AM |
35 | return rv; |
36 | } | |
37 | ||
38 | - rv = apr_socket_connect(sock, ap_listeners->bind_addr); | |
39 | + rv = apr_socket_connect(sock, lp->bind_addr); | |
40 | if (rv != APR_SUCCESS) { | |
41 | int log_level = APLOG_WARNING; | |
42 | ||
d9bb6656 | 43 | @@ -692,12 +704,12 @@ static apr_status_t dummy_connection(ap_ |
a0dc379f AM |
44 | } |
45 | ||
46 | ap_log_error(APLOG_MARK, log_level, rv, ap_server_conf, | |
47 | - "connect to listener on %pI", ap_listeners->bind_addr); | |
48 | + "connect to listener on %pI", lp->bind_addr); | |
49 | apr_pool_destroy(p); | |
50 | return rv; | |
51 | } | |
6b0efdb8 AM |
52 | |
53 | - if (ap_listeners->protocol && strcasecmp(ap_listeners->protocol, "https") == 0) { | |
54 | + if (lp->protocol && strcasecmp(lp->protocol, "https") == 0) { | |
55 | /* Send a TLS 1.0 close_notify alert. This is perhaps the | |
56 | * "least wrong" way to open and cleanly terminate an SSL | |
57 | * connection. It should "work" without noisy error logs if |