summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_keys.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-21 14:00:29 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-21 14:00:29 +0200
commitf93a0592b29b66c6bbacbb38f42e8dfd5a3a6aee (patch)
treeb0bc2b8a6a84919980e6b9a844ac773da26cfc5e /src/exchange/taler-exchange-httpd_keys.c
parenta51f39217ec3b659f938687e2146ceb17078733d (diff)
downloadexchange-f93a0592b29b66c6bbacbb38f42e8dfd5a3a6aee.tar.gz
exchange-f93a0592b29b66c6bbacbb38f42e8dfd5a3a6aee.tar.bz2
exchange-f93a0592b29b66c6bbacbb38f42e8dfd5a3a6aee.zip
-change handler signatures to prepare for long polling support
Diffstat (limited to 'src/exchange/taler-exchange-httpd_keys.c')
-rw-r--r--src/exchange/taler-exchange-httpd_keys.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c
index 0cc8c831c..216afd7c5 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -2053,18 +2053,16 @@ krd_search_comparator (const void *key,
MHD_RESULT
-TEH_keys_get_handler (const struct TEH_RequestHandler *rh,
- struct MHD_Connection *connection,
+TEH_keys_get_handler (struct TEH_RequestContext *rc,
const char *const args[])
{
struct GNUNET_TIME_Absolute last_issue_date;
- (void) rh;
(void) args;
{
const char *have_cherrypick;
- have_cherrypick = MHD_lookup_connection_value (connection,
+ have_cherrypick = MHD_lookup_connection_value (rc->connection,
MHD_GET_ARGUMENT_KIND,
"last_issue_date");
if (NULL != have_cherrypick)
@@ -2077,7 +2075,7 @@ TEH_keys_get_handler (const struct TEH_RequestHandler *rh,
&cherrypickn))
{
GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (connection,
+ return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_BAD_REQUEST,
TALER_EC_GENERIC_PARAMETER_MALFORMED,
have_cherrypick);
@@ -2103,16 +2101,16 @@ TEH_keys_get_handler (const struct TEH_RequestHandler *rh,
{
GNUNET_assert (0 == pthread_mutex_lock (&skr_mutex));
if ( (SKR_LIMIT == skr_size) &&
- (connection == skr_connection) )
+ (rc->connection == skr_connection) )
{
GNUNET_assert (0 == pthread_mutex_unlock (&skr_mutex));
- return TALER_MHD_reply_with_error (connection,
+ return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
"too many connections suspended on /keys");
}
GNUNET_assert (0 == pthread_mutex_unlock (&skr_mutex));
- return suspend_request (connection);
+ return suspend_request (rc->connection);
}
krd = bsearch (&last_issue_date,
ksh->krd_array,
@@ -2140,14 +2138,15 @@ TEH_keys_get_handler (const struct TEH_RequestHandler *rh,
NOT_FOUND situation. But, OTOH, for 'sane' clients it is more likely
to be our fault, so let's speculatively assume we are to blame ;-) *///
GNUNET_break (0);
- return TALER_MHD_reply_with_error (connection,
+ return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
"no key data for given timestamp");
}
- return MHD_queue_response (connection,
+ return MHD_queue_response (rc->connection,
MHD_HTTP_OK,
- (MHD_YES == TALER_MHD_can_compress (connection))
+ (MHD_YES ==
+ TALER_MHD_can_compress (rc->connection))
? krd->response_compressed
: krd->response_uncompressed);
}