diff options
author | default <nobody@localhost> | 2023-08-09 19:36:31 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-08-09 19:36:31 +0200 |
commit | 203dd883896c015429a60deaa16726af2402706f (patch) | |
tree | a47f468a3353e93580f9218c2bc7e5982e3e4ff5 /xs_curl.h | |
parent | 912cfb5aaa915829efe92cc34ad7ad888e93c14a (diff) |
Be more strict in not retrying on permanent errors.
Diffstat (limited to 'xs_curl.h')
-rw-r--r-- | xs_curl.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -169,8 +169,13 @@ xs_dict *xs_http_request(const char *method, const char *url, curl_slist_free_all(list); if (status != NULL) { - if (lstatus == 0) - lstatus = -cc; + if (lstatus == 0) { + /* set the timeout error to a fake HTTP status, or propagate as is */ + if (cc == CURLE_OPERATION_TIMEDOUT) + lstatus = 599; + else + lstatus = -cc; + } *status = (int) lstatus; } |