summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-02-07 13:34:26 +0100
committerGravatar default2023-02-07 13:34:26 +0100
commit944bd60e06b6be5153c3b7bb345bb811b31d96ac (patch)
tree2c8a3f06a65f85527363649fdd0d5f1418c7009f
parentOutput messages are now processed by the pool of threads. (diff)
downloadsnac2-944bd60e06b6be5153c3b7bb345bb811b31d96ac.tar.gz
snac2-944bd60e06b6be5153c3b7bb345bb811b31d96ac.tar.xz
snac2-944bd60e06b6be5153c3b7bb345bb811b31d96ac.zip
Deleted old output message processing in user queue.
-rw-r--r--activitypub.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/activitypub.c b/activitypub.c
index b54845d..cfff6ca 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1108,42 +1108,6 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
1108 } 1108 }
1109 } 1109 }
1110 else 1110 else
1111 if (strcmp(type, "output") == 0) {
1112 int status;
1113 xs_str *inbox = xs_dict_get(q_item, "inbox");
1114 xs_str *keyid = xs_dict_get(q_item, "keyid");
1115 xs_str *seckey = xs_dict_get(q_item, "seckey");
1116 xs_dict *msg = xs_dict_get(q_item, "message");
1117 int retries = xs_number_get(xs_dict_get(q_item, "retries"));
1118 xs *payload = NULL;
1119 int p_size = 0;
1120
1121 if (xs_is_null(inbox) || xs_is_null(msg) || xs_is_null(keyid) || xs_is_null(seckey)) {
1122 srv_log(xs_fmt("incomplete output message"));
1123 return;
1124 }
1125
1126 /* deliver */
1127 status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, retries == 0 ? 3 : 8);
1128
1129 snac_log(snac, xs_fmt("output sent to inbox %s %d", inbox, status));
1130
1131 if (!valid_status(status)) {
1132 /* error sending; requeue? */
1133 if (status == 404 || status == 410)
1134 /* explicit error: discard */
1135 snac_log(snac, xs_fmt("output error %s %d", inbox, status));
1136 else
1137 if (retries > queue_retry_max)
1138 snac_log(snac, xs_fmt("output giving up %s %d", inbox, status));
1139 else {
1140 /* requeue */
1141 enqueue_output(snac, msg, inbox, retries + 1);
1142 snac_log(snac, xs_fmt("output requeue %s #%d", inbox, retries + 1));
1143 }
1144 }
1145 }
1146 else
1147 if (strcmp(type, "input") == 0) { 1111 if (strcmp(type, "input") == 0) {
1148 /* process the message */ 1112 /* process the message */
1149 xs_dict *msg = xs_dict_get(q_item, "message"); 1113 xs_dict *msg = xs_dict_get(q_item, "message");