diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-11 13:23:47 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-11 13:23:47 -0600 |
commit | 7508de2e4ec10baf46c7cde6e7774051ac19e95a (patch) | |
tree | de1dfbd00cfed1f0987eabcc873d6e949b779300 /lib9p | |
parent | 74537d36cd9a32817d18163cccdb60f88b024950 (diff) |
lib9p: Implement Tflush
Diffstat (limited to 'lib9p')
-rw-r--r-- | lib9p/srv.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib9p/srv.c b/lib9p/srv.c index 610debf..1f62e27 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -72,7 +72,7 @@ struct _srv_sess { struct _lib9p_srv_req { /* immutable */ - struct _srv_sess *parent_sess; + struct _srv_sess *parent_sess; uint16_t tag; /* mutable */ uint8_t *net_bytes; /* CONFIG_9P_MAX_MSG_SIZE-sized */ @@ -288,7 +288,7 @@ COROUTINE lib9p_srv_write_cr(void *_srv) { handle_message(&req); /* Release resources. ****************************************/ - if (_lib9p_srv_flushch_can_send(&req.ctx._flushch)) + while (_lib9p_srv_flushch_can_send(&req.ctx._flushch)) _lib9p_srv_flushch_send(&req.ctx._flushch, false); reqmap_del(&req.parent_sess->reqs, req.tag); if (req.parent_sess->closing && !req.parent_sess->reqs.len) @@ -597,8 +597,9 @@ static void handle_Tflush(struct _lib9p_srv_req *ctx, struct lib9p_msg_Rflush *resp) { handler_common(ctx, req, resp); - lib9p_error(&ctx->ctx.basectx, - LINUX_EOPNOTSUPP, "flush not yet implemented"); + struct _lib9p_srv_req **oldreqp = reqmap_load(&ctx->parent_sess->reqs, req->oldtag); + if (oldreqp) + _lib9p_srv_flushch_recv(&((*oldreqp)->ctx._flushch)); } static void handle_Twalk(struct _lib9p_srv_req *ctx, |