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_cb_hdr.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_cb_hdr.c')
-rw-r--r-- | src/tool_cb_hdr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index 3844904c9..b0880f186 100644 --- a/src/tool_cb_hdr.c +++ b/src/tool_cb_hdr.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 @@ -32,6 +32,7 @@ #include "tool_msgs.h" #include "tool_cb_hdr.h" #include "tool_cb_wrt.h" +#include "tool_operate.h" #include "memdebug.h" /* keep this as LAST include */ @@ -54,9 +55,10 @@ static char *parse_filename(const char *ptr, size_t len); size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) { - struct HdrCbData *hdrcbdata = userdata; - struct OutStruct *outs = hdrcbdata->outs; - struct OutStruct *heads = hdrcbdata->heads; + struct per_transfer *per = userdata; + struct HdrCbData *hdrcbdata = &per->hdrcbdata; + struct OutStruct *outs = &per->outs; + struct OutStruct *heads = &per->heads; const char *str = ptr; const size_t cb = size * nmemb; const char *end = (char *)ptr + cb; @@ -100,7 +102,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) * Content-Disposition header specifying a filename property. */ - curl_easy_getinfo(outs->config->easy, CURLINFO_PROTOCOL, &protocol); + curl_easy_getinfo(per->curl, CURLINFO_PROTOCOL, &protocol); if(hdrcbdata->honor_cd_filename && (cb > 20) && checkprefix("Content-disposition:", str) && (protocol & (CURLPROTO_HTTPS|CURLPROTO_HTTP))) { |