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