]> granicus.if.org Git - apache/commitdiff
ab was sending wrong number of requests when keepalive enabled.
authorDaniel Earl Poirier <poirier@apache.org>
Mon, 3 May 2010 17:33:03 +0000 (17:33 +0000)
committerDaniel Earl Poirier <poirier@apache.org>
Mon, 3 May 2010 17:33:03 +0000 (17:33 +0000)
Thanks to Bryn Dole for the patch.
PR: 48497

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@940526 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
support/ab.c

diff --git a/CHANGES b/CHANGES
index a7b63f680f644dd5d8e172b5de672721eddbd6b1..f6e9cb5393cc3f7db8b9b123304cbce2847e215e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -28,6 +28,9 @@ Changes with Apache 2.3.7
      processing is completed, avoiding orphaned callback pointers.
      [Brett Gervasoni <brettg senseofsecurity.com>, Jeff Trawick]
 
+  *) ab: fix number of requests sent by ab when keepalive is enabled.  PR 48497.
+     [Bryn Dole <dole blekko.com>]
+
   *) Log an error for failures to read a chunk-size, and return 408 instead of
      413 when this is due to a read timeout.  This change also fixes some cases 
      of two error documents being sent in the response for the same scenario. 
index abb3c2017c04099afb987063268efd024615e2b6..e4e76705da76ca31f9ff21d5f8c4689a8706c715 100644 (file)
@@ -671,6 +671,10 @@ static void ssl_proceed_handshake(struct connection *c)
 
 static void write_request(struct connection * c)
 {
+    if (started >= requests) {
+        return;
+    }
+
     do {
         apr_time_t tnow;
         apr_size_t l = c->rwrite;
@@ -724,6 +728,7 @@ static void write_request(struct connection * c)
     } while (c->rwrite);
 
     c->endwrite = lasttime = apr_time_now();
+    started++;
     set_conn_state(c, STATE_READ);
 }
 
@@ -1267,7 +1272,6 @@ static void start_connect(struct connection * c)
 
     /* connected first time */
     set_conn_state(c, STATE_CONNECTED);
-    started++;
 #ifdef USE_SSL
     if (c->ssl) {
         ssl_proceed_handshake(c);
@@ -1798,7 +1802,6 @@ static void test(void)
                     }
                     else {
                         set_conn_state(c, STATE_CONNECTED);
-                        started++;
 #ifdef USE_SSL
                         if (c->ssl)
                             ssl_proceed_handshake(c);