diff options
| author | 2023-08-09 19:36:31 +0200 | |
|---|---|---|
| committer | 2023-08-09 19:36:31 +0200 | |
| commit | 203dd883896c015429a60deaa16726af2402706f (patch) | |
| tree | a47f468a3353e93580f9218c2bc7e5982e3e4ff5 /xs_curl.h | |
| parent | Backport from xs. (diff) | |
| download | penes-snac2-203dd883896c015429a60deaa16726af2402706f.tar.gz penes-snac2-203dd883896c015429a60deaa16726af2402706f.tar.xz penes-snac2-203dd883896c015429a60deaa16726af2402706f.zip | |
Be more strict in not retrying on permanent errors.
Diffstat (limited to '')
| -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, | |||
| 169 | curl_slist_free_all(list); | 169 | curl_slist_free_all(list); |
| 170 | 170 | ||
| 171 | if (status != NULL) { | 171 | if (status != NULL) { |
| 172 | if (lstatus == 0) | 172 | if (lstatus == 0) { |
| 173 | lstatus = -cc; | 173 | /* set the timeout error to a fake HTTP status, or propagate as is */ |
| 174 | if (cc == CURLE_OPERATION_TIMEDOUT) | ||
| 175 | lstatus = 599; | ||
| 176 | else | ||
| 177 | lstatus = -cc; | ||
| 178 | } | ||
| 174 | 179 | ||
| 175 | *status = (int) lstatus; | 180 | *status = (int) lstatus; |
| 176 | } | 181 | } |