diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-06-26 09:03:18 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-06-26 09:03:18 +0200 |
commit | d98eabf6c30d589bffaf7a1dba4df51c26d56c74 (patch) | |
tree | 49f76f4676d221829da001664465f1d366133c11 /src/mint-lib/mint_api_handle.c | |
parent | 47262f4316874f321ffdcbcdcb1d98c182375730 (diff) |
handle response code 0 more nicely
Diffstat (limited to 'src/mint-lib/mint_api_handle.c')
-rw-r--r-- | src/mint-lib/mint_api_handle.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mint-lib/mint_api_handle.c b/src/mint-lib/mint_api_handle.c index 530cd6062..6bcae9f60 100644 --- a/src/mint-lib/mint_api_handle.c +++ b/src/mint-lib/mint_api_handle.c @@ -574,8 +574,32 @@ keys_completed_cb (void *cls, { struct KeysRequest *kr = cls; struct TALER_MINT_Handle *mint = kr->mint; + long response_code; /* FIXME: might want to check response code? */ + if (CURLE_OK != + curl_easy_getinfo (eh, + CURLINFO_RESPONSE_CODE, + &response_code)) + { + /* unexpected error... */ + GNUNET_break (0); + response_code = 0; + } + switch (response_code) { + case 0: + kr->errno = 1; + break; + case MHD_HTTP_OK: + break; + default: + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Mint returned status code %u for /keys\n", + response_code); + kr->errno = 1; + break; + } + if ( (0 != kr->eno) || (GNUNET_OK != parse_response_keys_get (kr)) ) |