summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index 5fb60ba..ce3be35 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -2261,6 +2261,9 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
2261 return -1; 2261 return -1;
2262 } 2262 }
2263 2263
2264 /* this instance is alive */
2265 instance_failure(actor, 2);
2266
2264 /* question votes may not have a type */ 2267 /* question votes may not have a type */
2265 if (xs_is_null(type)) 2268 if (xs_is_null(type))
2266 type = "Note"; 2269 type = "Note";
@@ -3152,6 +3155,11 @@ void process_queue_item(xs_dict *q_item)
3152 return; 3155 return;
3153 } 3156 }
3154 3157
3158 if (instance_failure(inbox, 0)) {
3159 srv_debug(1, xs_fmt("too many failures for instance %s", inbox));
3160 return;
3161 }
3162
3155 /* deliver (if previous error status was a timeout, try now longer) */ 3163 /* deliver (if previous error status was a timeout, try now longer) */
3156 if (p_status == 599) 3164 if (p_status == 599)
3157 timeout = xs_number_get(xs_dict_get_def(srv_config, "queue_timeout_2", "8")); 3165 timeout = xs_number_get(xs_dict_get_def(srv_config, "queue_timeout_2", "8"));
@@ -3163,6 +3171,9 @@ void process_queue_item(xs_dict *q_item)
3163 3171
3164 status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, timeout); 3172 status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, timeout);
3165 3173
3174 /* register or clear a value for this instance */
3175 instance_failure(inbox, valid_status(status) ? 2 : 1);
3176
3166 if (payload) { 3177 if (payload) {
3167 if (p_size > 64) { 3178 if (p_size > 64) {
3168 /* trim the message */ 3179 /* trim the message */