diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Harden the request path, scan and error recovery
Diffstat (limited to '')
-rw-r--r--source/cache.h18
1 file changed, 10 insertions, 8 deletions
diff --git a/source/cache.h b/source/cache.h
index a653108..bae283c 100644
--- a/source/cache.h
+++ b/source/cache.h
@@ -19,18 +19,20 @@ typedef void (*cache_fill_fn)(void);
*/
extern int cache_process(int size, const char *path, const char *key, int ttl, cache_fill_fn fn);
-// Write one line per cache slot to stdout, giving its path, modification
-// time, size and key.
+/*
+ * Write one line per cache slot to stdout, giving its path, modification time,
+ * size and key.
+ */
extern int cache_ls(const char *path);
/*
- * Give up on the slot being filled, discarding what has been rendered into it
- * and putting stdout back on the client. Anything that ends a request part way
- * through rendering has to call this before it writes what the visitor should
- * see, because until then stdout is the cache file and the visitor is on
- * course to receive nothing at all. Does nothing when no slot is being filled.
+ * Give up on the slot being filled and put stdout back on the client, after
+ * sending what was rendered into the slot so far. Anything that ends a request
+ * part way through rendering has to call this before it writes what the
+ * visitor should see, because until then stdout is the cache file. Returns
+ * non-zero when a fill was abandoned and zero when none was in progress.
*/
-extern void cache_abandon_fill(void);
+extern int cache_abandon_fill(void);
extern unsigned long cache_hash_str(const char *str);