summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-12-17 15:21:16 +0100
committerdefault <nobody@localhost>2023-12-17 15:21:16 +0100
commitf8196b4ef6369b5cbaf746cbaf6101eba1fb783b (patch)
treee1142beb5839eaa332778c83c79cbfe5b0b0573e
parentad718e5b801edd19fd76fb7d2921533c21ffab38 (diff)
New function srv_archive_qitem().
-rw-r--r--activitypub.c4
-rw-r--r--data.c14
-rw-r--r--snac.h1
3 files changed, 18 insertions, 1 deletions
diff --git a/activitypub.c b/activitypub.c
index 130c283..fa06a89 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -2135,8 +2135,10 @@ void process_queue_item(xs_dict *q_item)
unlink(tmpfn);
- if (cnt == 0)
+ if (cnt == 0) {
+ srv_archive_qitem(q_item);
srv_debug(1, xs_fmt("no valid recipients for %s", tmpfn));
+ }
}
}
else
diff --git a/data.c b/data.c
index 2dfee50..36de138 100644
--- a/data.c
+++ b/data.c
@@ -2752,3 +2752,17 @@ void srv_archive_error(const char *prefix, const xs_str *err,
fclose(f);
}
}
+
+
+void srv_archive_qitem(xs_dict *q_item)
+/* archives a q_item in the error folder */
+{
+ xs *ntid = tid(0);
+ xs *fn = xs_fmt("%s/error/%s_qitem", srv_basedir, ntid);
+ FILE *f;
+
+ if ((f = fopen(fn, "w")) != NULL) {
+ xs_json_dump(q_item, 4, f);
+ fclose(f);
+ }
+}
diff --git a/snac.h b/snac.h
index 020aaa5..c192cd9 100644
--- a/snac.h
+++ b/snac.h
@@ -64,6 +64,7 @@ void srv_archive(const char *direction, const char *url, xs_dict *req,
const char *body, int b_size);
void srv_archive_error(const char *prefix, const xs_str *err,
const xs_dict *req, const xs_val *data);
+void srv_archive_qitem(xs_dict *q_item);
double mtime_nl(const char *fn, int *n_link);
#define mtime(fn) mtime_nl(fn, NULL)