diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-14 10:45:50 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-14 10:45:50 +0200 |
commit | 71c62583d81f149cef2bdbe13870da70b50f3cbd (patch) | |
tree | 8bc44d018fd3666344acfee2407dc0f63206780e /src | |
parent | cc54548aee7bc181b36e28c6758a888e82c16f65 (diff) | |
download | anastasis-71c62583d81f149cef2bdbe13870da70b50f3cbd.tar.gz anastasis-71c62583d81f149cef2bdbe13870da70b50f3cbd.tar.bz2 anastasis-71c62583d81f149cef2bdbe13870da70b50f3cbd.zip |
-improve docs on what truth is, make truth_mime optionalv0.0.0
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/anastasis-httpd_truth_upload.c | 7 | ||||
-rw-r--r-- | src/restclient/anastasis_api_truth_store.c | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/anastasis-httpd_truth_upload.c b/src/backend/anastasis-httpd_truth_upload.c index ada4d4c..451054f 100644 --- a/src/backend/anastasis-httpd_truth_upload.c +++ b/src/backend/anastasis-httpd_truth_upload.c @@ -522,7 +522,7 @@ AH_handler_truth_post ( struct ANASTASIS_CRYPTO_EncryptedKeyShareP keyshare_data; void *encrypted_truth; size_t encrypted_truth_size; - const char *truth_mime; + const char *truth_mime = ""; const char *type; enum GNUNET_DB_QueryStatus qs; uint32_t storage_years; @@ -535,8 +535,9 @@ AH_handler_truth_post ( GNUNET_JSON_spec_varsize ("encrypted_truth", &encrypted_truth, &encrypted_truth_size), - GNUNET_JSON_spec_string ("truth_mime", - &truth_mime), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_string ("truth_mime", + &truth_mime)), GNUNET_JSON_spec_uint32 ("storage_duration_years", &storage_years), GNUNET_JSON_spec_end () diff --git a/src/restclient/anastasis_api_truth_store.c b/src/restclient/anastasis_api_truth_store.c index 185e06b..74b9238 100644 --- a/src/restclient/anastasis_api_truth_store.c +++ b/src/restclient/anastasis_api_truth_store.c @@ -303,10 +303,9 @@ ANASTASIS_truth_store ( GNUNET_JSON_pack_data_varsize ("encrypted_truth", encrypted_truth, encrypted_truth_size), - GNUNET_JSON_pack_string ("truth_mime", - (NULL != truth_mime) - ? truth_mime - : ""), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_string ("truth_mime", + truth_mime)), GNUNET_JSON_pack_uint64 ("storage_duration_years", payment_years_requested)); json_str = json_dumps (truth_data, |