aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-09-28 14:37:07 +0200
committergrunfink <grunfink@comam.es>2025-09-28 14:37:07 +0200
commit5d95ffa9f6605fcabdf4bd0e7ac2614cde637127 (patch)
tree2f53b7d285c27a81b150fb29b2bc6383a5145289
parent335b90a9d1654aadb4e0d87114b82685defcd50b (diff)
Revert "New function actor_failure()."
This reverts commit 335b90a9d1654aadb4e0d87114b82685defcd50b.
-rw-r--r--data.c27
-rw-r--r--snac.h1
2 files changed, 9 insertions, 19 deletions
diff --git a/data.c b/data.c
index 3b9840e..4a16a82 100644
--- a/data.c
+++ b/data.c
@@ -3042,13 +3042,18 @@ xs_list *content_search(snac *user, const char *regex,
}
-int actor_failure(const char *id, int op)
-/* actor failure maintenance */
+int instance_failure(const char *url, int op)
+/* do some checks and accounting on instance failures */
{
int ret = 0;
+ xs *l = xs_split(url, "/");
+ const char *hostname = xs_list_get(l, 2);
double mt;
- xs *md5 = xs_md5_hex(id, strlen(id));
+ if (!xs_is_string(hostname))
+ return 0;
+
+ xs *md5 = xs_md5_hex(hostname, strlen(hostname));
xs *fn = xs_fmt("%s/failure/%s", srv_basedir, md5);
switch (op) {
@@ -3070,7 +3075,7 @@ int actor_failure(const char *id, int op)
/* only create once, as the date will be used */
if ((f = fopen(fn, "w")) != NULL) {
- fprintf(f, "%s\n", id);
+ fprintf(f, "%s\n", hostname);
fclose(f);
}
}
@@ -3088,20 +3093,6 @@ int actor_failure(const char *id, int op)
}
-int instance_failure(const char *url, int op)
-/* instance failure maintenance */
-{
- /* extract just the host name */
- xs *l = xs_split(url, "/");
- const char *hostname = xs_list_get(l, 2);
-
- if (!xs_is_string(hostname))
- return 0;
-
- return actor_failure(hostname, op);
-}
-
-
/** notifications **/
xs_str *notify_check_time(snac *snac, int reset)
diff --git a/snac.h b/snac.h
index 2d21887..1a58e0b 100644
--- a/snac.h
+++ b/snac.h
@@ -278,7 +278,6 @@ int content_match(const char *file, const xs_dict *msg);
xs_list *content_search(snac *user, const char *regex,
int priv, int skip, int show, int max_secs, int *timeout);
-int actor_failure(const char *id, int op);
int instance_failure(const char *url, int op);
void enqueue_input(snac *snac, const xs_dict *msg, const xs_dict *req, int retries);