aboutsummaryrefslogtreecommitdiff
path: root/src/curl
diff options
context:
space:
mode:
authorjospaeth <spaethj@in.tum.de>2020-08-28 12:27:32 +0200
committerjospaeth <spaethj@in.tum.de>2020-08-28 12:27:32 +0200
commit5f7d255ae5221c447367c4ac7a157ddcd27bcd57 (patch)
tree22fae70a54ad97c15a59f62e4c8bb9498a0d2e53 /src/curl
parent62d6be2695969cd430351b503b033057a1b50f47 (diff)
parentbbf9540c93da3c6b950920ee7eaae479c95403c5 (diff)
downloadgnunet-5f7d255ae5221c447367c4ac7a157ddcd27bcd57.tar.gz
gnunet-5f7d255ae5221c447367c4ac7a157ddcd27bcd57.zip
Merge branch 'master' into spaeth/escrow_plugins
Diffstat (limited to 'src/curl')
-rw-r--r--src/curl/curl.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/curl/curl.c b/src/curl/curl.c
index eb9dd6a29..d89c97176 100644
--- a/src/curl/curl.c
+++ b/src/curl/curl.c
@@ -472,6 +472,30 @@ setup_job (CURL *eh,
472 472
473 473
474/** 474/**
475 * Add @a extra_headers to the HTTP headers for @a job.
476 *
477 * @param[in,out] job the job to modify
478 * @param extra_headers headers to append
479 */
480void
481GNUNET_CURL_extend_headers (struct GNUNET_CURL_Job *job,
482 const struct curl_slist *extra_headers)
483{
484 struct curl_slist *all_headers = job->job_headers;
485
486 for (const struct curl_slist *curr = extra_headers;
487 NULL != curr;
488 curr = curr->next)
489 {
490 GNUNET_assert (NULL !=
491 (all_headers = curl_slist_append (all_headers,
492 curr->data)));
493 }
494 job->job_headers = all_headers;
495}
496
497
498/**
475 * Schedule a CURL request to be executed and call the given @a jcc 499 * Schedule a CURL request to be executed and call the given @a jcc
476 * upon its completion. Note that the context will make use of the 500 * upon its completion. Note that the context will make use of the
477 * CURLOPT_PRIVATE facility of the CURL @a eh. Used to download 501 * CURLOPT_PRIVATE facility of the CURL @a eh. Used to download
@@ -864,7 +888,8 @@ do_benchmark (CURLMsg *cmsg)
864 curl -w "foo%{size_request} -XPOST --data "ABC" $URL 888 curl -w "foo%{size_request} -XPOST --data "ABC" $URL
865 the CURLINFO_REQUEST_SIZE should be the whole size of the request 889 the CURLINFO_REQUEST_SIZE should be the whole size of the request
866 including headers and body. 890 including headers and body.
867 */GNUNET_break (size_curl <= size_long); 891 *///
892 GNUNET_break (size_curl <= size_long);
868 893
869 urd = get_url_benchmark_data (url, (unsigned int) response_code); 894 urd = get_url_benchmark_data (url, (unsigned int) response_code);
870 urd->count++; 895 urd->count++;