diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-06-13 18:38:08 +0200 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-06-13 18:39:07 +0200 |
commit | 1a7fbccc8b3fd6fc070d134892e736503286ef1b (patch) | |
tree | 95390f15a2581e43ebbc83fb0ccd9ffcf7c4ff8e /src/curl | |
parent | e532e871ca89b8a78700756fef1284de15f479c8 (diff) | |
download | gnunet-1a7fbccc8b3fd6fc070d134892e736503286ef1b.tar.gz gnunet-1a7fbccc8b3fd6fc070d134892e736503286ef1b.zip |
Expanding libgnunetcurl.
Adding a method to let the user append
a custom request header.
Diffstat (limited to 'src/curl')
-rw-r--r-- | src/curl/curl.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/curl/curl.c b/src/curl/curl.c index 2d0b09d92..cdd39ab8e 100644 --- a/src/curl/curl.c +++ b/src/curl/curl.c | |||
@@ -448,6 +448,25 @@ download_get_result (struct DownloadBuffer *db, | |||
448 | 448 | ||
449 | 449 | ||
450 | /** | 450 | /** |
451 | * Add custom request header. | ||
452 | * | ||
453 | * @param ctx cURL context. | ||
454 | * @param header header string; will be given to the context AS IS. | ||
455 | * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise. | ||
456 | */ | ||
457 | int | ||
458 | GNUNET_CURL_append_header (struct GNUNET_CURL_Context *ctx, | ||
459 | const char *header) | ||
460 | { | ||
461 | ctx->json_header = curl_slist_append (ctx->json_header, | ||
462 | header); | ||
463 | if (NULL == ctx->json_header) | ||
464 | return GNUNET_SYSERR; | ||
465 | |||
466 | return GNUNET_OK; | ||
467 | } | ||
468 | |||
469 | /** | ||
451 | * Run the main event loop for the Taler interaction. | 470 | * Run the main event loop for the Taler interaction. |
452 | * | 471 | * |
453 | * @param ctx the library context | 472 | * @param ctx the library context |