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_metalink.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/tool_metalink.c') diff --git a/src/tool_metalink.c b/src/tool_metalink.c index 28aa71707..0740407f9 100644 --- a/src/tool_metalink.c +++ b/src/tool_metalink.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 @@ -104,6 +104,7 @@ struct win32_crypto_hash { #include "tool_paramhlp.h" #include "tool_cfgable.h" #include "tool_metalink.h" +#include "tool_operate.h" #include "tool_msgs.h" #include "memdebug.h" /* keep this as LAST include */ @@ -674,8 +675,9 @@ int metalink_check_hash(struct GlobalConfig *config, return rv; } -static metalink_checksum *new_metalink_checksum_from_hex_digest -(const metalink_digest_def *digest_def, const char *hex_digest) +static metalink_checksum * +checksum_from_hex_digest(const metalink_digest_def *digest_def, + const char *hex_digest) { metalink_checksum *chksum; unsigned char *digest; @@ -754,8 +756,8 @@ static metalinkfile *new_metalinkfile(metalink_file_t *fileinfo) if(curl_strequal(digest_alias->alias_name, (*p)->type) && check_hex_digest((*p)->hash, digest_alias->digest_def)) { f->checksum = - new_metalink_checksum_from_hex_digest(digest_alias->digest_def, - (*p)->hash); + checksum_from_hex_digest(digest_alias->digest_def, + (*p)->hash); break; } } @@ -891,7 +893,8 @@ int parse_metalink(struct OperationConfig *config, struct OutStruct *outs, size_t metalink_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata) { - struct OutStruct *outs = userdata; + struct per_transfer *per = userdata; + struct OutStruct *outs = &per->outs; struct OperationConfig *config = outs->config; int rv; -- cgit v1.2.1