summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_mhd.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-02-26 17:00:41 +0100
committerChristian Grothoff <christian@grothoff.org>2020-02-26 17:00:41 +0100
commitfb9324338d9580b520b3713bf973bfcd9c49b569 (patch)
treeaa90b29dbad21957c864834895fe6b00272a058f /src/exchange/taler-exchange-httpd_mhd.c
parent30b24448c8250b01eba8368f38c9ccdc2075f903 (diff)
downloadexchange-fb9324338d9580b520b3713bf973bfcd9c49b569.tar.gz
exchange-fb9324338d9580b520b3713bf973bfcd9c49b569.tar.bz2
exchange-fb9324338d9580b520b3713bf973bfcd9c49b569.zip
phase 1 of #6067: update exchange HTTPD to new API style
Diffstat (limited to 'src/exchange/taler-exchange-httpd_mhd.c')
-rw-r--r--src/exchange/taler-exchange-httpd_mhd.c52
1 files changed, 18 insertions, 34 deletions
diff --git a/src/exchange/taler-exchange-httpd_mhd.c b/src/exchange/taler-exchange-httpd_mhd.c
index 0f2ce033a..0d59fad1b 100644
--- a/src/exchange/taler-exchange-httpd_mhd.c
+++ b/src/exchange/taler-exchange-httpd_mhd.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014 Taler Systems SA
+ Copyright (C) 2014-2020 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -39,27 +39,23 @@
*
* @param rh context of the handler
* @param connection the MHD connection to handle
- * @param[in,out] connection_cls the connection's closure (can be updated)
- * @param upload_data upload data
- * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
+ * @param args array of additional options (must be empty for this function)
* @return MHD result code
*/
int
-TEH_MHD_handler_static_response (struct TEH_RequestHandler *rh,
+TEH_MHD_handler_static_response (const struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
- void **connection_cls,
- const char *upload_data,
- size_t *upload_data_size)
+ const char *const args[])
{
struct MHD_Response *response;
int ret;
+ size_t dlen;
- (void) connection_cls;
- (void) upload_data;
- (void) upload_data_size;
- if (0 == rh->data_size)
- rh->data_size = strlen ((const char *) rh->data);
- response = MHD_create_response_from_buffer (rh->data_size,
+ (void) args;
+ dlen = (0 == rh->data_size)
+ ? strlen ((const char *) rh->data)
+ : rh->data_size;
+ response = MHD_create_response_from_buffer (dlen,
(void *) rh->data,
MHD_RESPMEM_PERSISTENT);
if (NULL == response)
@@ -86,22 +82,16 @@ TEH_MHD_handler_static_response (struct TEH_RequestHandler *rh,
*
* @param rh context of the handler
* @param connection the MHD connection to handle
- * @param[in,out] connection_cls the connection's closure (can be updated)
- * @param upload_data upload data
- * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
+ * @param args array of additional options (must be empty for this function)
* @return MHD result code
*/
int
-TEH_MHD_handler_agpl_redirect (struct TEH_RequestHandler *rh,
+TEH_MHD_handler_agpl_redirect (const struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
- void **connection_cls,
- const char *upload_data,
- size_t *upload_data_size)
+ const char *const args[])
{
(void) rh;
- (void) connection_cls;
- (void) upload_data;
- (void) upload_data_size;
+ (void) args;
return TALER_MHD_reply_agpl (connection,
"http://www.git.taler.net/?p=exchange.git");
}
@@ -113,21 +103,15 @@ TEH_MHD_handler_agpl_redirect (struct TEH_RequestHandler *rh,
*
* @param rh context of the handler
* @param connection the MHD connection to handle
- * @param[in,out] connection_cls the connection's closure (can be updated)
- * @param upload_data upload data
- * @param[in,out] upload_data_size number of bytes (left) in @a upload_data
+ * @param args array of additional options (must be empty for this function)
* @return MHD result code
*/
int
-TEH_MHD_handler_send_json_pack_error (struct TEH_RequestHandler *rh,
+TEH_MHD_handler_send_json_pack_error (const struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
- void **connection_cls,
- const char *upload_data,
- size_t *upload_data_size)
+ const char *const args[])
{
- (void) connection_cls;
- (void) upload_data;
- (void) upload_data_size;
+ (void) args;
return TALER_MHD_reply_with_error (connection,
rh->response_code,
TALER_EC_METHOD_INVALID,