summaryrefslogtreecommitdiff
path: root/lib9p/include
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-04 19:38:42 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-04 19:38:42 -0600
commit4f7cf6b416ccede492ace64533ab35a9a289f463 (patch)
treedb28d138f8b6d4c9bf71f2790881ea04f68b3ece /lib9p/include
parent860a9e995b8e7076ce4e5c231e844184bef9b95e (diff)
wip
Diffstat (limited to 'lib9p/include')
-rw-r--r--lib9p/include/lib9p/srv.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib9p/include/lib9p/srv.h b/lib9p/include/lib9p/srv.h
index 0211260..d2ada62 100644
--- a/lib9p/include/lib9p/srv.h
+++ b/lib9p/include/lib9p/srv.h
@@ -10,8 +10,23 @@ struct lib9p_srv_reqctx {
struct lib9p_ctx *base;
uint32_t uid;
char *uname;
+
+ cr_chan_t(bool) _flushch;
};
+static inline bool flush_requested(struct lib9p_srv_reqctx *ctx) {
+ assert(ctx);
+ return cr_chan_can_write(&ctx->_flushch);
+}
+
+static inline int acknowledge_flush(struct lib9p_srv_reqctx *ctx) {
+ assert(ctx);
+ assert(cr_chan_can_send(&ctx->_flushch));
+ lib9p_error(ctx->base, LINUX_ECANCELED, "request canceled by flush");
+ cr_chan_send(&ctx->_flushch, true);
+ return -1;
+}
+
/* vtables you must implement *************************************************/
struct lib9p_srv_file_vtable {