diff options
Diffstat (limited to 'src/auditor/taler-auditor-httpd_db.c')
-rw-r--r-- | src/auditor/taler-auditor-httpd_db.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/auditor/taler-auditor-httpd_db.c b/src/auditor/taler-auditor-httpd_db.c index 846829551..e0ab8f2e1 100644 --- a/src/auditor/taler-auditor-httpd_db.c +++ b/src/auditor/taler-auditor-httpd_db.c @@ -51,9 +51,9 @@ int TAH_DB_run_transaction (struct MHD_Connection *connection, const char *name, - int *mhd_ret, - TAH_DB_TransactionCallback cb, - void *cb_cls) + int *mhd_ret, + TAH_DB_TransactionCallback cb, + void *cb_cls) { struct TALER_AUDITORDB_Session *session; @@ -64,46 +64,47 @@ TAH_DB_run_transaction (struct MHD_Connection *connection, GNUNET_break (0); if (NULL != mhd_ret) *mhd_ret = TAH_RESPONSE_reply_internal_db_error (connection, - TALER_EC_DB_SETUP_FAILED); + TALER_EC_DB_SETUP_FAILED); return GNUNET_SYSERR; } // TAH_plugin->preflight (TAH_plugin->cls, session); // FIXME: needed? - for (unsigned int retries = 0;retries < MAX_TRANSACTION_COMMIT_RETRIES; retries++) + for (unsigned int retries = 0; retries < MAX_TRANSACTION_COMMIT_RETRIES; + retries++) { enum GNUNET_DB_QueryStatus qs; if (GNUNET_OK != - TAH_plugin->start (TAH_plugin->cls, - session)) + TAH_plugin->start (TAH_plugin->cls, + session)) { GNUNET_break (0); if (NULL != mhd_ret) - *mhd_ret = TAH_RESPONSE_reply_internal_db_error (connection, - TALER_EC_DB_START_FAILED); + *mhd_ret = TAH_RESPONSE_reply_internal_db_error (connection, + TALER_EC_DB_START_FAILED); return GNUNET_SYSERR; } qs = cb (cb_cls, - connection, - session, - mhd_ret); + connection, + session, + mhd_ret); if (0 > qs) TAH_plugin->rollback (TAH_plugin->cls, - session); + session); if (GNUNET_DB_STATUS_HARD_ERROR == qs) return GNUNET_SYSERR; if (0 <= qs) qs = TAH_plugin->commit (TAH_plugin->cls, - session); + session); if (GNUNET_DB_STATUS_HARD_ERROR == qs) { if (NULL != mhd_ret) - *mhd_ret = TAH_RESPONSE_reply_commit_error (connection, - TALER_EC_DB_COMMIT_FAILED_HARD); + *mhd_ret = TAH_RESPONSE_reply_commit_error (connection, + TALER_EC_DB_COMMIT_FAILED_HARD); return GNUNET_SYSERR; } /* make sure callback did not violate invariants! */ GNUNET_assert ( (NULL == mhd_ret) || - (-1 == *mhd_ret) ); + (-1 == *mhd_ret) ); if (0 <= qs) return GNUNET_OK; } @@ -112,7 +113,7 @@ TAH_DB_run_transaction (struct MHD_Connection *connection, MAX_TRANSACTION_COMMIT_RETRIES); if (NULL != mhd_ret) *mhd_ret = TAH_RESPONSE_reply_commit_error (connection, - TALER_EC_DB_COMMIT_FAILED_ON_RETRY); + TALER_EC_DB_COMMIT_FAILED_ON_RETRY); return GNUNET_SYSERR; } |