diff options
Diffstat (limited to 'lib9p/srv.c')
-rw-r--r-- | lib9p/srv.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib9p/srv.c b/lib9p/srv.c index c624fa8..580c5f5 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -293,12 +293,14 @@ static void handle_message(struct _lib9p_srv_req *ctx); _lib9p_srv_reqch_send_req(&srv->_reqch, &req); } close: - LO_CALL(conn.fd, close, true, sess.reqs.len == 0); - if (sess.reqs.len) { + if (sess.reqs.len == 0) + io_close(conn.fd); + else { + io_close_read(conn.fd); sess.closing = true; cr_pause_and_yield(); assert(sess.reqs.len == 0); - LO_CALL(conn.fd, close, true, true); + io_close_write(conn.fd); } } } |