File: 082_ab_num_requests.dpatch

package info (click to toggle)
apache2 2.2.16-6%2Bsqueeze15
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 38,516 kB
  • ctags: 20,767
  • sloc: ansic: 227,630; sh: 22,460; perl: 2,191; makefile: 1,244; awk: 1,133; pascal: 517; lex: 191; python: 136; yacc: 100; xml: 36
file content (45 lines) | stat: -rw-r--r-- 1,249 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/sh /usr/share/dpatch/dpatch-run
## 082_ab_num_requests.dpatch by Stefan Fritsch <sf@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Upstream r940526, Debian bug #541158

@DPATCH@
diff -urNad trunk~/support/ab.c trunk/support/ab.c
--- trunk~/support/ab.c	2010-07-16 22:17:41.697762479 +0200
+++ trunk/support/ab.c	2010-07-16 22:17:45.661763246 +0200
@@ -628,6 +628,10 @@
 
 static void write_request(struct connection * c)
 {
+    if (started >= requests) {
+        return;
+    }
+
     do {
         apr_time_t tnow;
         apr_size_t l = c->rwrite;
@@ -690,6 +694,7 @@
         new_pollfd.client_data = c;
         apr_pollset_add(readbits, &new_pollfd);
     }
+    started++;
 }
 
 /* --------------------------------------------------------- */
@@ -1239,7 +1244,6 @@
 
     /* connected first time */
     c->state = STATE_CONNECTED;
-    started++;
 #ifdef USE_SSL
     if (c->ssl) {
         ssl_proceed_handshake(c);
@@ -1766,7 +1770,6 @@
                     }
                     else {
                         c->state = STATE_CONNECTED;
-                        started++;
 #ifdef USE_SSL
                         if (c->ssl)
                             ssl_proceed_handshake(c);