]> granicus.if.org Git - apache/commitdiff
Merge r1364133, r1371791 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 14 Aug 2012 20:52:53 +0000 (20:52 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 14 Aug 2012 20:52:53 +0000 (20:52 +0000)
When -B is specified, search for a host address in the
same family as the specified outbound interface.  If
impossible, fail at name resolution instead of bind().

ab: Fix read failure when targeting SSL server.

Submitted by: trawick
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1373084 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
support/ab.c

diff --git a/CHANGES b/CHANGES
index 2f7cba3cf501aaf647bef24a790b4c01e4a2265d..03a7607c3c4c93401405b1a6d765df358725656b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,8 @@ Changes with Apache 2.4.3
      possible XSS for a site where untrusted users can upload files to
      a location with MultiViews enabled. [Niels Heinen <heinenn google.com>]
 
+  *) ab: Fix read failure when targeting SSL server.  [Jeff Trawick]
+
   *) The following now respect DefaultRuntimeDir/DEFAULT_REL_RUNTIMEDIR:
      - mod_auth_digest: shared memory file
      [Jeff Trawick]
diff --git a/STATUS b/STATUS
index 9aa1cdea6f9112eb19fb79fa3f5f99bbd58fdfa5..2ac399ca34e6481b9ce08a058fa28deafa734fcc 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -93,15 +93,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.4.x patch: trunk patch works
      +1: rjung, humbedooh, trawick (needs CHANGES entry)
 
-   * ab fixes:
-     o When -B is specified, search for a host address in the same
-       family as the specified outbound interface.
-     o Fix read failure when targeting SSL server.
-     trunk patches: http://svn.apache.org/viewvc?view=revision&revision=1364133
-                    http://svn.apache.org/viewvc?view=revision&revision=1371791
-     2.4.x patch: trunk patches work
-     +1: trawick, rjung, jim
-
    * httpd.conf.in: remove DNT header field from MSIE 10.0 requests because
        the browser is deliberately violating the standard under development.
      trunk patch: http://svn.apache.org/viewvc?rev=1371878&view=rev
index d2b1a986f9307665527f6c958f07aee75b4dd4d8..133084db818909b883283d4bb270733ae4370814 100644 (file)
@@ -1347,11 +1347,21 @@ static void read_connection(struct connection * c)
                 good++;
                 close_connection(c);
             }
+            else if (scode == SSL_ERROR_SYSCALL
+                     && status == 0
+                     && c->read != 0) {
+                /* connection closed, but in violation of the protocol, after
+                 * some data has already been read; this commonly happens, so
+                 * let the length check catch any response errors
+                 */
+                good++;
+                close_connection(c);
+            }
             else if (scode != SSL_ERROR_WANT_WRITE
                      && scode != SSL_ERROR_WANT_READ) {
                 /* some fatal error: */
                 c->read = 0;
-                BIO_printf(bio_err, "SSL read failed - closing connection\n");
+                BIO_printf(bio_err, "SSL read failed (%d) - closing connection\n", scode);
                 ERR_print_errors(bio_err);
                 close_connection(c);
             }
@@ -1700,7 +1710,9 @@ static void test(void)
     }
 
     /* This too */
-    if ((rv = apr_sockaddr_info_get(&destsa, connecthost, APR_UNSPEC, connectport, 0, cntxt))
+    if ((rv = apr_sockaddr_info_get(&destsa, connecthost, 
+                                    myhost ? mysa->family : APR_UNSPEC,
+                                    connectport, 0, cntxt))
        != APR_SUCCESS) {
         char buf[120];
         apr_snprintf(buf, sizeof(buf),