diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-07-20 19:14:00 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-07-20 19:14:16 +0200 |
commit | b88940850002a3f1c25bc6488b95ad30eb80d696 (patch) | |
tree | 9af44fc7571282e3adc379dbbff06d4d34c6c2b6 /src/tool_operhlp.c | |
parent | 14a385b3aec7f2f1c6a5247cf41c785990dfb39e (diff) | |
download | curl-b88940850002a3f1c25bc6488b95ad30eb80d696.tar.gz |
curl: support parallel transfers
This is done by making sure each individual transfer is first added to a
linked list as then they can be performed serially, or at will, in
parallel.
Closes #3804
Diffstat (limited to 'src/tool_operhlp.c')
-rw-r--r-- | src/tool_operhlp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index c3a826278..f3fcc699f 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2019, 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 @@ -71,10 +71,13 @@ bool stdin_upload(const char *uploadfile) * Adds the file name to the URL if it doesn't already have one. * url will be freed before return if the returned pointer is different */ -char *add_file_name_to_url(CURL *curl, char *url, const char *filename) +char *add_file_name_to_url(char *url, const char *filename) { /* If no file name part is given in the URL, we add this file name */ char *ptr = strstr(url, "://"); + CURL *curl = curl_easy_init(); /* for url escaping */ + if(!curl) + return NULL; /* error! */ if(ptr) ptr += 3; else @@ -120,6 +123,7 @@ char *add_file_name_to_url(CURL *curl, char *url, const char *filename) else Curl_safefree(url); } + curl_easy_cleanup(curl); return url; } |