aboutsummaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2026-06-24 14:54:45 +0200
committergrunfink <grunfink@comam.es>2026-06-24 14:54:45 +0200
commitef7b66697f5b3261a451917d2996563a141df68a (patch)
tree71c0f409f07dbd25ebde0c17543e93ad934781cc /activitypub.c
parent778046fa7ab73e64b6a30021f1c81fc72c58bea7 (diff)
Implemented semi-random forward_secs in enqueue_object_request() or enqueue_actor_refresh().
If forward_secs is a negative value in these functions, it's used as the modulo of a hash of the user id. This way, a refresh storm of the same object by all users is somewhat distributed in time.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c
index e9be2de..514e764 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -3077,7 +3077,7 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
else {
/* actor / key mismatch: don't accept blindly, but request an actor update
from the original source, as the Update may come from a relay and be legit */
- enqueue_actor_refresh(snac, actor, 0);
+ enqueue_actor_refresh(snac, actor, -10);
snac_log(snac, xs_fmt("Update: mismatched actor '%s' and key '%s'", actor, key_id));
}
@@ -3097,7 +3097,7 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
else
if (strcmp(atto, key_id) != 0) {
/* actor / key mismatch: request the object from the original source */
- enqueue_object_request(snac, id, 0);
+ enqueue_object_request(snac, id, -10);
snac_log(snac, xs_fmt("Update: mismatched attributedTo '%s' and key '%s'", atto, key_id));
}