8335b1
diff --git a/support/ab.c b/support/ab.c
8335b1
index bf76406..80c1b74 100644
8335b1
--- a/support/ab.c
8335b1
+++ b/support/ab.c
8335b1
@@ -1346,11 +1346,21 @@ static void read_connection(struct connection * c)
8335b1
                      && good == 0) {
8335b1
                 return;
8335b1
             }
8335b1
+            else if (scode == SSL_ERROR_SYSCALL
8335b1
+                     && status == 0
8335b1
+                     && c->read != 0) {
8335b1
+                /* connection closed, but in violation of the protocol, after
8335b1
+                 * some data has already been read; this commonly happens, so
8335b1
+                 * let the length check catch any response errors
8335b1
+                 */
8335b1
+                good++;
8335b1
+                close_connection(c);
8335b1
+            }
8335b1
             else if (scode != SSL_ERROR_WANT_WRITE
8335b1
                      && scode != SSL_ERROR_WANT_READ) {
8335b1
                 /* some fatal error: */
8335b1
                 c->read = 0;
8335b1
-                BIO_printf(bio_err, "SSL read failed (%d) - closing connection\n", scode);
8335b1
+                BIO_printf(bio_err, "SSL read failed (%d) - closing connection\n", scode);
8335b1
                 ERR_print_errors(bio_err);
8335b1
                 close_connection(c);
8335b1
             }