]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib530: make it less timing sensible
authorDaniel Stenberg <daniel@haxx.se>
Mon, 23 Feb 2015 23:06:36 +0000 (00:06 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 24 Feb 2015 10:50:19 +0000 (11:50 +0100)
... by making sure the first request is completed before doing the
remainder.

tests/libtest/lib530.c

index 06a846439e150cdd1b7ebaf70fdc7860a65b2230..e60d1172942f4884bb27da5313a68fcad6e0d297 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -83,13 +83,15 @@ int test(char *URL)
 
     abort_on_test_timeout();
 
-    if(!running && handles_added >= NUM_HANDLES)
-      break; /* done */
+    if(!running) {
+      if(handles_added >= NUM_HANDLES)
+        break; /* done */
 
-    /* Add the rest of the handles now that the first handle has sent the
-       request. */
-    while(handles_added < NUM_HANDLES)
-      multi_add_handle(m, curl[handles_added++]);
+      /* Add the rest of the handles now that the first handle has completed
+         its request. */
+      while(handles_added < NUM_HANDLES)
+        multi_add_handle(m, curl[handles_added++]);
+    }
 
     FD_ZERO(&rd);
     FD_ZERO(&wr);