]> granicus.if.org Git - curl/commitdiff
tool_cfgable: Added support for knowing the current operation
authorSteve Holme <steve_holme@hotmail.com>
Sun, 23 Feb 2014 15:30:24 +0000 (15:30 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Mon, 24 Feb 2014 21:25:36 +0000 (21:25 +0000)
src/tool_cfgable.h
src/tool_operate.c

index 69c2c2ee9ad41a79faac73e77f925f840f3763cc..78d17c7d333a25a43dfac8b71b217ac4ba4f1ebc 100644 (file)
@@ -224,6 +224,7 @@ struct GlobalConfig {
   CURL *easy;                     /* Once we have one, we keep it here */
 
   struct OperationConfig *first;
+  struct OperationConfig *current;
   struct OperationConfig *last;   /* Always last in the struct */
 };
 
index 25aa9413d12ddef4d3033d33d37de235b2a11a2f..6458c11a9516f2a085d74c0cba0902cec44f6e99 100644 (file)
@@ -1831,14 +1831,14 @@ CURLcode operate(struct GlobalConfig *config, int argc, argv_item_t argv[])
         operation = operation->next;
       }
 
-      /* Reset the operation pointer */
-      operation = config->first;
+      /* Set the current operation pointer */
+      config->current = config->first;
 
       /* Perform each operation */
-      while(!result && operation) {
-        result = operate_do(operation);
+      while(!result && config->current) {
+        result = operate_do(config->current);
 
-        operation = operation->next;
+        config->current = config->current->next;
       }
     }
   }