commit 073a2d9

default  ·  2023-09-02 06:41:29 +0000 UTC
parent 4e87a11
Discard output messages to blocked instances.
2 files changed,  +10, -2
M data.c
+5, -0
 1@@ -1875,6 +1875,11 @@ void process_queue_item(xs_dict *q_item)
 2             return;
 3         }
 4 
 5+        if (is_instance_blocked(inbox)) {
 6+            srv_debug(0, xs_fmt("discarded output message to blocked instance %s", inbox));
 7+            return;
 8+        }
 9+
10         /* deliver */
11         status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, retries == 0 ? 3 : 8);
12 
M data.c
+5, -2
 1@@ -1759,8 +1759,11 @@ void inbox_add_by_actor(const xs_dict *actor)
 2     char *v;
 3 
 4     if (!xs_is_null(v = xs_dict_get(actor, "endpoints")) &&
 5-        !xs_is_null(v = xs_dict_get(v, "sharedInbox")))
 6-        inbox_add(v);
 7+        !xs_is_null(v = xs_dict_get(v, "sharedInbox"))) {
 8+        /* only collect this inbox if its instance is not blocked */
 9+        if (!is_instance_blocked(v))
10+            inbox_add(v);
11+    }
12 }
13 
14