aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2012-02-06 10:46:25 +0100
committerDaniel Stenberg <daniel@haxx.se>2012-02-06 16:52:17 +0100
commit65103efe49a733ba0a4e50c8bd1e318ed31463f4 (patch)
tree7a688e68e091133fc79afb76213044976a7cdbf1 /src
parent466150bc64de0caef08f22cc8a88f7922483a639 (diff)
curl tool: don't abort glob-loop due to failures
We want to continue to the next URL to try even on failures returned from libcurl. This makes -f with ranges still get subsequent URLs even if occasional ones return error. This was a regression as it used to work and broke in the 7.23.0 release. Added test case 1328 to verify the fix. Bug: http://curl.haxx.se/bug/view.cgi?id=3481223 Reported by: Juan Barreto
Diffstat (limited to 'src')
-rw-r--r--src/tool_operate.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index a6f6f0b90..d086ac50a 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, 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
@@ -384,7 +384,7 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
URLGlob *inglob;
outfiles = NULL;
- infilenum = 0;
+ infilenum = 1;
inglob = NULL;
/* urlnode->url is the full URL (it might be NULL) */
@@ -422,7 +422,7 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
/* Here's the loop for uploading multiple files within the same
single globbed string. If no upload, we enter the loop once anyway. */
- for(up = 0 ;; up++) {
+ for(up = 0 ; up < infilenum; up++) {
char *uploadfile; /* a single file, never a glob */
int separator;
@@ -472,7 +472,7 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
separator= ((!outfiles || curlx_strequal(outfiles, "-")) && urlnum > 1);
/* Here's looping around each globbed URL */
- for(i = 0 ;; i++) {
+ for(i = 0 ; i < urlnum; i++) {
int infd;
bool infdopen;
@@ -1463,10 +1463,6 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
infd = STDIN_FILENO;
}
- /* upon error exit loop */
- if(res)
- break;
-
} /* loop to the next URL */
/* Free loop-local allocated memory */
@@ -1479,10 +1475,6 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
urls = NULL;
}
- /* upon error exit loop */
- if(res)
- break;
-
} /* loop to the next globbed upload file */
/* Free loop-local allocated memory */