summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'data.c')
-rw-r--r--data.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/data.c b/data.c
index 4f0d42a..ecc227e 100644
--- a/data.c
+++ b/data.c
@@ -1681,18 +1681,23 @@ void history_add(snac *snac, const char *id, const char *content, int size)
1681} 1681}
1682 1682
1683 1683
1684xs_str *history_get(snac *snac, const char *id) 1684int history_get(snac *snac, const char *id, xs_str **content, int *size,
1685 const char *inm, xs_str **etag)
1685{ 1686{
1686 xs_str *content = NULL;
1687 xs *fn = _history_fn(snac, id); 1687 xs *fn = _history_fn(snac, id);
1688 FILE *f; 1688 FILE *f;
1689 int status = 404;
1689 1690
1690 if (fn && (f = fopen(fn, "r")) != NULL) { 1691 if (fn && (f = fopen(fn, "r")) != NULL) {
1691 content = xs_readall(f); 1692 *content = xs_readall(f);
1692 fclose(f); 1693 fclose(f);
1694
1695 *size = strlen(*content);
1696
1697 status = 200;
1693 } 1698 }
1694 1699
1695 return content; 1700 return status;
1696} 1701}
1697 1702
1698 1703