[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: more refactoring for libtalermhd
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: more refactoring for libtalermhd |
Date: |
Sat, 23 Nov 2019 21:06:27 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new 8f006e77 more refactoring for libtalermhd
8f006e77 is described below
commit 8f006e779e12fed604182faa096ebe6b5726d04d
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Nov 23 21:06:25 2019 +0100
more refactoring for libtalermhd
---
src/exchange/taler-exchange-httpd_db.c | 31 +++++++++++++++++++---------
src/exchange/taler-exchange-httpd_keystate.c | 6 +++---
2 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_db.c
b/src/exchange/taler-exchange-httpd_db.c
index 37bd2379..19781f97 100644
--- a/src/exchange/taler-exchange-httpd_db.c
+++ b/src/exchange/taler-exchange-httpd_db.c
@@ -23,6 +23,7 @@
#include <jansson.h>
#include <gnunet/gnunet_json_lib.h>
#include "taler_json_lib.h"
+#include "taler_mhd_lib.h"
#include "taler-exchange-httpd_responses.h"
#include "taler-exchange-httpd_keystate.h"
@@ -62,8 +63,10 @@ TEH_DB_know_coin_transaction (void *cls,
if (GNUNET_DB_STATUS_HARD_ERROR == qs)
{
*mhd_ret
- = TEH_RESPONSE_reply_internal_db_error (connection,
-
TALER_EC_DB_COIN_HISTORY_STORE_ERROR);
+ = TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_DB_COIN_HISTORY_STORE_ERROR,
+ "could not persist coin data");
return GNUNET_DB_STATUS_HARD_ERROR;
}
return qs;
@@ -99,8 +102,10 @@ TEH_DB_run_transaction (struct MHD_Connection *connection,
{
GNUNET_break (0);
if (NULL != mhd_ret)
- *mhd_ret = TEH_RESPONSE_reply_internal_db_error (connection,
-
TALER_EC_DB_SETUP_FAILED);
+ *mhd_ret = TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_DB_SETUP_FAILED,
+ "could not establish database
session");
return GNUNET_SYSERR;
}
TEH_plugin->preflight (TEH_plugin->cls,
@@ -117,8 +122,10 @@ TEH_DB_run_transaction (struct MHD_Connection *connection,
{
GNUNET_break (0);
if (NULL != mhd_ret)
- *mhd_ret = TEH_RESPONSE_reply_internal_db_error (connection,
-
TALER_EC_DB_START_FAILED);
+ *mhd_ret = TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_DB_START_FAILED,
+ "could not begin transaction");
return GNUNET_SYSERR;
}
qs = cb (cb_cls,
@@ -136,8 +143,10 @@ TEH_DB_run_transaction (struct MHD_Connection *connection,
if (GNUNET_DB_STATUS_HARD_ERROR == qs)
{
if (NULL != mhd_ret)
- *mhd_ret = TEH_RESPONSE_reply_commit_error (connection,
-
TALER_EC_DB_COMMIT_FAILED_HARD);
+ *mhd_ret = TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_DB_COMMIT_FAILED_HARD,
+ "could not commit database
transaction");
return GNUNET_SYSERR;
}
/* make sure callback did not violate invariants! */
@@ -150,8 +159,10 @@ TEH_DB_run_transaction (struct MHD_Connection *connection,
name,
MAX_TRANSACTION_COMMIT_RETRIES);
if (NULL != mhd_ret)
- *mhd_ret = TEH_RESPONSE_reply_commit_error (connection,
-
TALER_EC_DB_COMMIT_FAILED_ON_RETRY);
+ *mhd_ret = TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_DB_COMMIT_FAILED_ON_RETRY,
+ "repatedly failed to serialize
database transaction");
return GNUNET_SYSERR;
}
diff --git a/src/exchange/taler-exchange-httpd_keystate.c
b/src/exchange/taler-exchange-httpd_keystate.c
index 7297a741..cf5cbe9a 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -1243,7 +1243,7 @@ setup_general_response_headers (const struct
TEH_KS_StateHandle *key_state,
{
char dat[128];
- TEH_RESPONSE_add_global_headers (response);
+ TALER_MHD_add_global_headers (response);
GNUNET_break (MHD_YES ==
MHD_add_response_header (response,
MHD_HTTP_HEADER_CONTENT_TYPE,
@@ -1546,8 +1546,8 @@ build_keys_response (const struct ResponseFactoryContext
*rfc,
}
/* Also compute compressed version of /keys response */
- comp = TEH_RESPONSE_body_compress (&keys_jsonz,
- &keys_jsonz_size);
+ comp = TALER_MHD_body_compress (&keys_jsonz,
+ &keys_jsonz_size);
krd->response_compressed
= MHD_create_response_from_buffer (keys_jsonz_size,
keys_jsonz,
--
To stop receiving notification emails like this one, please contact
address@hidden.