diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-09-30 21:29:08 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-05 19:18:09 -0600 |
commit | 4da8e81989f6ed86628d6497397b22e0cd8daf53 (patch) | |
tree | 28b196bf4e54fca41b514f13f533afcf9d3aed3c /lib9p/srv.c | |
parent | 83219ac2d9dced37578297dc9a01612b234e6b33 (diff) |
libcr_ipc: Redo
Diffstat (limited to 'lib9p/srv.c')
-rw-r--r-- | lib9p/srv.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib9p/srv.c b/lib9p/srv.c index 9bfe19e..478a642 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -190,8 +190,7 @@ COROUTINE lib9p_srv_read_cr(void *_srv) { goto close; /* Handle the message... in another coroutine. */ - cr_chan_send(&srv->reqch, &req); - cr_pause_and_yield(); /* wait for it to have copied req */ + _lib9p_srv_reqch_send_req(&srv->_reqch, &req); } close: netio_close(conn.fd, true, sess.reqs.len == 0); @@ -235,12 +234,12 @@ COROUTINE lib9p_srv_write_cr(void *_srv) { for (;;) { /* Receive the request from the reader coroutine. */ struct lib9p_req req; - struct lib9p_req *_req_p; - cr_chan_recv(&srv->reqch, &_req_p); - req = *_req_p; + _lib9p_srv_reqch_req_t req_handle; + req_handle = _lib9p_srv_reqch_recv_req(&srv->_reqch); + req = *req_handle.req; memcpy(net, req.net_bytes, decode_u32le(req.net_bytes)); req.net_bytes = net; - cr_unpause(req.parent_sess->parent_conn->reader); /* notify that we've copied req */ + _lib9p_srv_reqch_send_resp(req_handle, 0); /* notify that we've copied req */ handle_Tmessage(&req); |