diff options
Diffstat (limited to 'src/mint/taler-mint-httpd_db.c')
-rw-r--r-- | src/mint/taler-mint-httpd_db.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/mint/taler-mint-httpd_db.c b/src/mint/taler-mint-httpd_db.c index f5aa11722..bcdda621a 100644 --- a/src/mint/taler-mint-httpd_db.c +++ b/src/mint/taler-mint-httpd_db.c | |||
@@ -25,6 +25,7 @@ | |||
25 | * - /deposit: check for leaks | 25 | * - /deposit: check for leaks |
26 | * - ALL: check API: given structs are usually not perfect, as they | 26 | * - ALL: check API: given structs are usually not perfect, as they |
27 | * often contain too many fields for the context | 27 | * often contain too many fields for the context |
28 | * - ALL: check transactional behavior | ||
28 | */ | 29 | */ |
29 | #include "platform.h" | 30 | #include "platform.h" |
30 | #include <pthread.h> | 31 | #include <pthread.h> |
@@ -59,8 +60,7 @@ TALER_MINT_db_execute_deposit (struct MHD_Connection *connection, | |||
59 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) | 60 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) |
60 | { | 61 | { |
61 | GNUNET_break (0); | 62 | GNUNET_break (0); |
62 | return TALER_MINT_reply_internal_error (connection, | 63 | return TALER_MINT_reply_internal_db_error (connection); |
63 | "Failed to connect to database"); | ||
64 | } | 64 | } |
65 | res = TALER_MINT_DB_get_deposit (db_conn, | 65 | res = TALER_MINT_DB_get_deposit (db_conn, |
66 | &deposit->coin_pub, | 66 | &deposit->coin_pub, |
@@ -176,12 +176,10 @@ TALER_MINT_db_execute_withdraw_status (struct MHD_Connection *connection, | |||
176 | struct MintKeyState *key_state; | 176 | struct MintKeyState *key_state; |
177 | int must_update = GNUNET_NO; | 177 | int must_update = GNUNET_NO; |
178 | 178 | ||
179 | |||
180 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) | 179 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) |
181 | { | 180 | { |
182 | GNUNET_break (0); | 181 | GNUNET_break (0); |
183 | return TALER_MINT_reply_internal_error (connection, | 182 | return TALER_MINT_reply_internal_db_error (connection); |
184 | "Failed to connect to database"); | ||
185 | } | 183 | } |
186 | res = TALER_MINT_DB_get_reserve (db_conn, | 184 | res = TALER_MINT_DB_get_reserve (db_conn, |
187 | reserve_pub, | 185 | reserve_pub, |
@@ -245,9 +243,8 @@ TALER_MINT_db_execute_withdraw_sign (struct MHD_Connection *connection, | |||
245 | 243 | ||
246 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) | 244 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) |
247 | { | 245 | { |
248 | // FIXME: return 'internal error'? | ||
249 | GNUNET_break (0); | 246 | GNUNET_break (0); |
250 | return MHD_NO; | 247 | return TALER_MINT_reply_internal_db_error (connection); |
251 | } | 248 | } |
252 | 249 | ||
253 | 250 | ||
@@ -576,8 +573,8 @@ TALER_MINT_db_execute_refresh_melt (struct MHD_Connection *connection, | |||
576 | 573 | ||
577 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) | 574 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) |
578 | { | 575 | { |
579 | /* FIXME: return error code to MHD! */ | 576 | GNUNET_break (0); |
580 | return MHD_NO; | 577 | return TALER_MINT_reply_internal_db_error (connection); |
581 | } | 578 | } |
582 | res = TALER_MINT_DB_get_refresh_session (db_conn, | 579 | res = TALER_MINT_DB_get_refresh_session (db_conn, |
583 | refresh_session_pub, | 580 | refresh_session_pub, |
@@ -717,9 +714,8 @@ TALER_MINT_db_execute_refresh_commit (struct MHD_Connection *connection, | |||
717 | 714 | ||
718 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) | 715 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) |
719 | { | 716 | { |
720 | // FIXME: return 'internal error'? | ||
721 | GNUNET_break (0); | 717 | GNUNET_break (0); |
722 | return MHD_NO; | 718 | return TALER_MINT_reply_internal_db_error (connection); |
723 | } | 719 | } |
724 | 720 | ||
725 | /* Send response immediately if we already know the session. | 721 | /* Send response immediately if we already know the session. |
@@ -864,8 +860,7 @@ TALER_MINT_db_execute_refresh_link (struct MHD_Connection *connection, | |||
864 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) | 860 | if (NULL == (db_conn = TALER_MINT_DB_get_connection ())) |
865 | { | 861 | { |
866 | GNUNET_break (0); | 862 | GNUNET_break (0); |
867 | // FIXME: return error code! | 863 | return TALER_MINT_reply_internal_db_error (connection); |
868 | return MHD_NO; | ||
869 | } | 864 | } |
870 | 865 | ||
871 | res = TALER_db_get_transfer (db_conn, | 866 | res = TALER_db_get_transfer (db_conn, |
@@ -920,6 +915,4 @@ TALER_MINT_db_execute_refresh_link (struct MHD_Connection *connection, | |||
920 | return TALER_MINT_reply_json (connection, | 915 | return TALER_MINT_reply_json (connection, |
921 | root, | 916 | root, |
922 | MHD_HTTP_OK); | 917 | MHD_HTTP_OK); |
923 | |||
924 | |||
925 | } | 918 | } |