altarch-user / rpms / httpd

Forked from rpms/httpd 2 years ago
Clone

Blame SOURCES/httpd-2.4.6-ab-ssl-error.patch

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