mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-25 16:53:37 +00:00
Be more strict in not retrying on permanent errors.
This commit is contained in:
parent
912cfb5aaa
commit
203dd88389
3 changed files with 10 additions and 5 deletions
|
@ -1430,8 +1430,8 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
|
|||
/* bring the actor */
|
||||
a_status = actor_request(snac, actor, &actor_o);
|
||||
|
||||
/* if the actor does not explicitly exist, discard */
|
||||
if (a_status == 404 || a_status == 410) {
|
||||
/* do not retry permanent failures */
|
||||
if (a_status == 404 || a_status == 410 || a_status < 0) {
|
||||
snac_debug(snac, 1,
|
||||
xs_fmt("dropping message due to actor error %s %d", actor, a_status));
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
/* ac9fa6f1941aa3e701bbb1da50b4d5a07090eddb */
|
||||
/* 246a8bc9941850f68bf9034662a8a96bcd33926d */
|
||||
|
|
Loading…
Reference in a new issue