2011-10-04 18:03:20 -04:00
|
|
|
#ifndef HEADER_CURL_TOOL_OPERATE_H
|
|
|
|
#define HEADER_CURL_TOOL_OPERATE_H
|
2011-09-17 19:58:18 -04:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2020-05-13 18:05:04 -04:00
|
|
|
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2011-09-17 19:58:18 -04:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2020-11-04 08:02:01 -05:00
|
|
|
* are also available at https://curl.se/docs/copyright.html.
|
2011-09-17 19:58:18 -04:00
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2012-04-06 17:35:15 -04:00
|
|
|
#include "tool_setup.h"
|
2019-07-20 13:14:00 -04:00
|
|
|
#include "tool_cb_hdr.h"
|
|
|
|
#include "tool_cb_prg.h"
|
|
|
|
#include "tool_sdecls.h"
|
|
|
|
|
|
|
|
struct per_transfer {
|
|
|
|
/* double linked */
|
|
|
|
struct per_transfer *next;
|
|
|
|
struct per_transfer *prev;
|
|
|
|
struct OperationConfig *config; /* for this transfer */
|
|
|
|
CURL *curl;
|
|
|
|
long retry_numretries;
|
|
|
|
long retry_sleep_default;
|
|
|
|
long retry_sleep;
|
|
|
|
struct timeval retrystart;
|
|
|
|
bool metalink; /* nonzero for metalink download. */
|
|
|
|
bool metalink_next_res;
|
2020-05-13 18:05:04 -04:00
|
|
|
struct metalinkfile *mlfile;
|
|
|
|
struct metalink_resource *mlres;
|
2019-07-20 13:14:00 -04:00
|
|
|
char *this_url;
|
2020-12-14 04:09:51 -05:00
|
|
|
unsigned int urlnum; /* the index of the given URL */
|
2019-07-20 13:14:00 -04:00
|
|
|
char *outfile;
|
|
|
|
bool infdopen; /* TRUE if infd needs closing */
|
|
|
|
int infd;
|
2019-11-26 03:16:19 -05:00
|
|
|
bool noprogress;
|
2019-07-20 13:14:00 -04:00
|
|
|
struct ProgressData progressbar;
|
|
|
|
struct OutStruct outs;
|
|
|
|
struct OutStruct heads;
|
2019-10-30 04:43:14 -04:00
|
|
|
struct OutStruct etag_save;
|
2019-07-20 13:14:00 -04:00
|
|
|
struct InStruct input;
|
|
|
|
struct HdrCbData hdrcbdata;
|
2020-09-09 11:05:49 -04:00
|
|
|
long num_headers;
|
|
|
|
bool was_last_header_empty;
|
2019-07-20 13:14:00 -04:00
|
|
|
char errorbuffer[CURL_ERROR_SIZE];
|
|
|
|
|
|
|
|
bool added; /* set TRUE when added to the multi handle */
|
2020-09-05 11:44:24 -04:00
|
|
|
time_t startat; /* when doing parallel transfers, this is a retry transfer
|
|
|
|
that has been set to sleep until this time before it
|
|
|
|
should get started (again) */
|
2019-07-20 13:14:00 -04:00
|
|
|
|
|
|
|
/* for parallel progress bar */
|
|
|
|
curl_off_t dltotal;
|
|
|
|
curl_off_t dlnow;
|
|
|
|
curl_off_t ultotal;
|
|
|
|
curl_off_t ulnow;
|
|
|
|
bool dltotal_added; /* if the total has been added from this */
|
|
|
|
bool ultotal_added;
|
|
|
|
|
|
|
|
/* NULL or malloced */
|
|
|
|
char *separator_err;
|
|
|
|
char *separator;
|
|
|
|
char *uploadfile;
|
|
|
|
};
|
2011-09-17 19:58:18 -04:00
|
|
|
|
2014-02-23 09:32:22 -05:00
|
|
|
CURLcode operate(struct GlobalConfig *config, int argc, argv_item_t argv[]);
|
2011-09-17 19:58:18 -04:00
|
|
|
|
2019-07-20 13:14:00 -04:00
|
|
|
extern struct per_transfer *transfers; /* first node */
|
|
|
|
|
2011-10-04 18:03:20 -04:00
|
|
|
#endif /* HEADER_CURL_TOOL_OPERATE_H */
|