diff options
Diffstat (limited to 'src/restclient/anastasis_api_policy_store.c')
-rw-r--r-- | src/restclient/anastasis_api_policy_store.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/restclient/anastasis_api_policy_store.c b/src/restclient/anastasis_api_policy_store.c index b709472..2432079 100644 --- a/src/restclient/anastasis_api_policy_store.c +++ b/src/restclient/anastasis_api_policy_store.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of ANASTASIS | 2 | This file is part of ANASTASIS |
3 | Copyright (C) 2014-2021 Anastasis SARL | 3 | Copyright (C) 2014-2022 Anastasis SARL |
4 | 4 | ||
5 | ANASTASIS is free software; you can redistribute it and/or modify | 5 | ANASTASIS is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as | 6 | it under the terms of the GNU General Public License as |
@@ -356,6 +356,8 @@ ANASTASIS_policy_store ( | |||
356 | const struct ANASTASIS_CRYPTO_AccountPrivateKeyP *anastasis_priv, | 356 | const struct ANASTASIS_CRYPTO_AccountPrivateKeyP *anastasis_priv, |
357 | const void *recovery_data, | 357 | const void *recovery_data, |
358 | size_t recovery_data_size, | 358 | size_t recovery_data_size, |
359 | const void *recovery_meta_data, | ||
360 | size_t recovery_meta_data_size, | ||
359 | uint32_t payment_years_requested, | 361 | uint32_t payment_years_requested, |
360 | const struct ANASTASIS_PaymentSecretP *payment_secret, | 362 | const struct ANASTASIS_PaymentSecretP *payment_secret, |
361 | struct GNUNET_TIME_Relative payment_timeout, | 363 | struct GNUNET_TIME_Relative payment_timeout, |
@@ -425,6 +427,31 @@ ANASTASIS_policy_store ( | |||
425 | } | 427 | } |
426 | job_headers = ext; | 428 | job_headers = ext; |
427 | 429 | ||
430 | /* Setup meta-data header */ | ||
431 | if (NULL != recovery_meta_data) | ||
432 | { | ||
433 | char *meta_val; | ||
434 | |||
435 | meta_val = GNUNET_STRINGS_data_to_string_alloc ( | ||
436 | recovery_meta_data, | ||
437 | recovery_meta_data_size); | ||
438 | GNUNET_asprintf (&hdr, | ||
439 | "%s: %s", | ||
440 | ANASTASIS_HTTP_HEADER_POLICY_META_DATA, | ||
441 | meta_val); | ||
442 | GNUNET_free (meta_val); | ||
443 | ext = curl_slist_append (job_headers, | ||
444 | hdr); | ||
445 | GNUNET_free (hdr); | ||
446 | if (NULL == ext) | ||
447 | { | ||
448 | GNUNET_break (0); | ||
449 | curl_slist_free_all (job_headers); | ||
450 | return NULL; | ||
451 | } | ||
452 | job_headers = ext; | ||
453 | } | ||
454 | |||
428 | /* Setup Payment-Identifier header */ | 455 | /* Setup Payment-Identifier header */ |
429 | if (NULL != payment_secret) | 456 | if (NULL != payment_secret) |
430 | { | 457 | { |