diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-03-15 11:19:25 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-03-17 01:37:11 +0100 |
commit | ec3f361cc3547bf2fbc48259ce2191926afb9c5e (patch) | |
tree | 04737349686d0492c00282ece9ed6b2ba4adf94c /src/lib/testing_api_cmd_history.c | |
parent | b55506b39509657aba64be1a4e22c5bf32c934f9 (diff) |
malforming /history response body, and avoid extracting
error codes from NULL responses.
Diffstat (limited to 'src/lib/testing_api_cmd_history.c')
-rw-r--r-- | src/lib/testing_api_cmd_history.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/testing_api_cmd_history.c b/src/lib/testing_api_cmd_history.c index b9763cfe..8cad77aa 100644 --- a/src/lib/testing_api_cmd_history.c +++ b/src/lib/testing_api_cmd_history.c @@ -158,16 +158,16 @@ history_cb (void *cls, hs->ho = NULL; - /* 410 is a convenience status that is used to - * trigger the "unexpected response code" in the - * lib, that should then result in a 0 status code - * passed here to the callback. */ - if (MHD_HTTP_GONE == hs->http_status) - { - if (0 != http_status) + + if (hs->http_status != http_status) TALER_TESTING_FAIL (hs->is); - - TALER_TESTING_interpreter_next (hs->is); + + if (0 == hs->http_status) + { + /* 0 was caused intentionally by the tests, + * move on without further checking. */ + TALER_TESTING_interpreter_next (hs->is); + return; } nresult = json_array_size (json); |