check for 204 first

This commit is contained in:
Christian Grothoff 2020-01-15 22:11:32 +01:00
parent 16a6d39dc9
commit 77281fa319
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 25 additions and 22 deletions

View File

@ -507,15 +507,6 @@ history_cb (void *cls,
struct HistoryState *hs = is->commands[is->ip].cls; struct HistoryState *hs = is->commands[is->ip].cls;
(void) row_id; (void) row_id;
if (MHD_HTTP_OK != http_status)
{
hs->hh = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unwanted response code from /history: %u\n",
http_status);
TALER_TESTING_interpreter_fail (is);
return GNUNET_SYSERR;
}
if (NULL == details) if (NULL == details)
{ {
hs->hh = NULL; hs->hh = NULL;
@ -541,6 +532,15 @@ history_cb (void *cls,
TALER_TESTING_interpreter_next (is); TALER_TESTING_interpreter_next (is);
return GNUNET_OK; return GNUNET_OK;
} }
if (MHD_HTTP_OK != http_status)
{
hs->hh = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unwanted response code from /history: %u\n",
http_status);
TALER_TESTING_interpreter_fail (is);
return GNUNET_SYSERR;
}
/* check current element */ /* check current element */
if (GNUNET_OK != check_result (is, if (GNUNET_OK != check_result (is,

View File

@ -205,8 +205,10 @@ build_history (struct TALER_TESTING_Interpreter *is,
add_incoming_cmd = TALER_TESTING_interpreter_lookup_command add_incoming_cmd = TALER_TESTING_interpreter_lookup_command
(is, hs->start_row_reference); (is, hs->start_row_reference);
GNUNET_assert (NULL != add_incoming_cmd); GNUNET_assert (NULL != add_incoming_cmd);
GNUNET_assert (GNUNET_OK == TALER_TESTING_get_trait_uint64 GNUNET_assert (GNUNET_OK ==
(add_incoming_cmd, 0, &row_id_start)); TALER_TESTING_get_trait_uint64 (add_incoming_cmd,
0,
&row_id_start));
} }
GNUNET_assert (0 != hs->num_results); GNUNET_assert (0 != hs->num_results);
@ -330,8 +332,9 @@ build_history (struct TALER_TESTING_Interpreter *is,
const char *credit_account; const char *credit_account;
const char *debit_account; const char *debit_account;
if (GNUNET_OK != TALER_TESTING_GET_TRAIT_ROW_ID if (GNUNET_OK !=
(pos, &row_id)) TALER_TESTING_GET_TRAIT_ROW_ID (pos,
&row_id))
continue; continue;
if (NULL != row_id_start) if (NULL != row_id_start)
@ -511,15 +514,6 @@ history_cb (void *cls,
struct HistoryState *hs = is->commands[is->ip].cls; struct HistoryState *hs = is->commands[is->ip].cls;
(void) row_id; (void) row_id;
if (MHD_HTTP_OK != http_status)
{
hs->hh = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unwanted response code from /history: %u\n",
http_status);
TALER_TESTING_interpreter_fail (is);
return GNUNET_SYSERR;
}
if (NULL == details) if (NULL == details)
{ {
hs->hh = NULL; hs->hh = NULL;
@ -545,6 +539,15 @@ history_cb (void *cls,
TALER_TESTING_interpreter_next (is); TALER_TESTING_interpreter_next (is);
return GNUNET_OK; return GNUNET_OK;
} }
if (MHD_HTTP_OK != http_status)
{
hs->hh = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unwanted response code from /history: %u\n",
http_status);
TALER_TESTING_interpreter_fail (is);
return GNUNET_SYSERR;
}
/* check current element */ /* check current element */
if (GNUNET_OK != check_result (is, if (GNUNET_OK != check_result (is,