From b88940850002a3f1c25bc6488b95ad30eb80d696 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 20 Jul 2019 19:14:00 +0200 Subject: 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 --- src/tool_operhlp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/tool_operhlp.c') 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, , et al. + * Copyright (C) 1998 - 2019, Daniel Stenberg, , 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; } -- cgit v1.2.1