tool_operate.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef HEADER_CURL_TOOL_OPERATE_H
  2. #define HEADER_CURL_TOOL_OPERATE_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at https://curl.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. ***************************************************************************/
  24. #include "tool_setup.h"
  25. #include "tool_cb_hdr.h"
  26. #include "tool_cb_prg.h"
  27. #include "tool_sdecls.h"
  28. struct per_transfer {
  29. /* double linked */
  30. struct per_transfer *next;
  31. struct per_transfer *prev;
  32. struct OperationConfig *config; /* for this transfer */
  33. CURL *curl;
  34. long retry_numretries;
  35. long retry_sleep_default;
  36. long retry_sleep;
  37. struct timeval retrystart;
  38. char *this_url;
  39. unsigned int urlnum; /* the index of the given URL */
  40. char *outfile;
  41. bool infdopen; /* TRUE if infd needs closing */
  42. int infd;
  43. bool noprogress;
  44. struct ProgressData progressbar;
  45. struct OutStruct outs;
  46. struct OutStruct heads;
  47. struct OutStruct etag_save;
  48. struct InStruct input;
  49. struct HdrCbData hdrcbdata;
  50. long num_headers;
  51. bool was_last_header_empty;
  52. char errorbuffer[CURL_ERROR_SIZE];
  53. bool added; /* set TRUE when added to the multi handle */
  54. time_t startat; /* when doing parallel transfers, this is a retry transfer
  55. that has been set to sleep until this time before it
  56. should get started (again) */
  57. /* for parallel progress bar */
  58. curl_off_t dltotal;
  59. curl_off_t dlnow;
  60. curl_off_t ultotal;
  61. curl_off_t ulnow;
  62. bool dltotal_added; /* if the total has been added from this */
  63. bool ultotal_added;
  64. /* NULL or malloced */
  65. char *separator_err;
  66. char *separator;
  67. char *uploadfile;
  68. };
  69. CURLcode operate(struct GlobalConfig *config, int argc, argv_item_t argv[]);
  70. extern struct per_transfer *transfers; /* first node */
  71. #endif /* HEADER_CURL_TOOL_OPERATE_H */