summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-12-29 10:58:21 +0100
committerdefault <nobody@localhost>2023-12-29 10:58:21 +0100
commitb31abde6bd65e666da3de4dc0a4aea3da42211cc (patch)
treef94fa10286f2bae0004211b6a62cf81d49db354e /httpd.c
parent3414ab48c6b97cfd358472f0dc87b6d28387b4b4 (diff)
Minor tweaks to /.well-known/nodeinfo returned data.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/httpd.c b/httpd.c
index f4cc46c..25740df 100644
--- a/httpd.c
+++ b/httpd.c
@@ -62,14 +62,14 @@ xs_str *nodeinfo_2_0(void)
int n_uhyear = 0;
int n_posts = 0;
xs *users = user_list();
- xs_list *p;
+ xs_list *p = users;
char *v;
+ double now = (double)time(NULL);
- p = users;
while (xs_list_iter(&p, &v)) {
/* build the full path name to the last usage log */
xs *llfn = xs_fmt("%s/user/%s/lastlog.txt", srv_basedir, v);
- double llsecs = (double)time(NULL) - mtime(llfn);
+ double llsecs = now - mtime(llfn);
if (llsecs < 60 * 60 * 24 * 30 * 6) {
n_uhyear++;
@@ -81,7 +81,7 @@ xs_str *nodeinfo_2_0(void)
n_utotal++;
/* build the file to each user public.idx */
- xs *pidxfn = xs_fmt("%s/user/%s/private.idx", srv_basedir, v);
+ xs *pidxfn = xs_fmt("%s/user/%s/public.idx", srv_basedir, v);
n_posts += index_len(pidxfn);
}