summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_keystate.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-11-23 18:47:07 +0100
committerChristian Grothoff <christian@grothoff.org>2019-11-23 18:47:07 +0100
commite8a88392da98c3325ba39b20901a5c220158d1f5 (patch)
treeb2e43949d8ec80d0a24a256479a67547e4a3730f /src/exchange/taler-exchange-httpd_keystate.c
parent8bca461ea9f604e4bce279255663f207f0d104ac (diff)
downloadexchange-e8a88392da98c3325ba39b20901a5c220158d1f5.tar.gz
exchange-e8a88392da98c3325ba39b20901a5c220158d1f5.tar.bz2
exchange-e8a88392da98c3325ba39b20901a5c220158d1f5.zip
more refactoring towards using libtalermhd
Diffstat (limited to 'src/exchange/taler-exchange-httpd_keystate.c')
-rw-r--r--src/exchange/taler-exchange-httpd_keystate.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/exchange/taler-exchange-httpd_keystate.c b/src/exchange/taler-exchange-httpd_keystate.c
index bde5c7d7e..7297a741b 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -23,6 +23,7 @@
#include "platform.h"
#include <pthread.h>
#include "taler_json_lib.h"
+#include "taler_mhd_lib.h"
#include "taler-exchange-httpd_keystate.h"
#include "taler-exchange-httpd_responses.h"
#include "taler_exchangedb_plugin.h"
@@ -2378,9 +2379,10 @@ TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
&cherrypickn))
{
GNUNET_break_op (0);
- return TEH_RESPONSE_reply_arg_invalid (connection,
- TALER_EC_KEYS_HAVE_NOT_NUMERIC,
- "last_issue_date");
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_KEYS_HAVE_NOT_NUMERIC,
+ "last_issue_date");
}
last_issue_date.abs_value_us = (uint64_t) cherrypickn * 1000000LLU;
}
@@ -2402,9 +2404,10 @@ TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
&fakenown))
{
GNUNET_break_op (0);
- return TEH_RESPONSE_reply_arg_invalid (connection,
- TALER_EC_KEYS_HAVE_NOT_NUMERIC,
- "now");
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_KEYS_HAVE_NOT_NUMERIC,
+ "now");
}
now.abs_value_us = (uint64_t) fakenown * 1000000LLU;
}
@@ -2413,9 +2416,10 @@ TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
if (NULL == key_state)
{
TALER_LOG_ERROR ("Lacking keys to operate\n");
- return TEH_RESPONSE_reply_internal_error (connection,
- TALER_EC_EXCHANGE_BAD_CONFIGURATION,
- "no keys");
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_EXCHANGE_BAD_CONFIGURATION,
+ "no keys");
}
krd = bsearch (&last_issue_date,
key_state->krd_array,
@@ -2444,7 +2448,7 @@ TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
}
ret = MHD_queue_response (connection,
rh->response_code,
- (MHD_YES == TEH_RESPONSE_can_compress (connection))
+ (MHD_YES == TALER_MHD_can_compress (connection))
? krd->response_compressed
: krd->response_uncompressed);
TEH_KS_release (key_state);