summaryrefslogtreecommitdiff
path: root/src/tool_metalink.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-07-20 19:14:00 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-07-20 19:14:16 +0200
commitb88940850002a3f1c25bc6488b95ad30eb80d696 (patch)
tree9af44fc7571282e3adc379dbbff06d4d34c6c2b6 /src/tool_metalink.c
parent14a385b3aec7f2f1c6a5247cf41c785990dfb39e (diff)
downloadcurl-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_metalink.c')
-rw-r--r--src/tool_metalink.c15
1 files changed, 9 insertions, 6 deletions
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, <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
@@ -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;