diff options
Diffstat (limited to 'lib9p/srv.c')
-rw-r--r-- | lib9p/srv.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib9p/srv.c b/lib9p/srv.c index 077db83..ee28b38 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -182,6 +182,7 @@ COROUTINE lib9p_srv_read_cr(void *_srv) { .initialized = false, }; for (;;) { + nextmsg: /* Read the message. */ size_t done = 0; if (read_at_least(conn.fd, buf, 4, &done)) @@ -211,7 +212,7 @@ COROUTINE lib9p_srv_read_cr(void *_srv) { goal, sess.max_msg_size); respond_error(&req); - continue; + goto nextmsg; } if (read_at_least(conn.fd, buf, goal, &done)) goto close; @@ -225,7 +226,7 @@ COROUTINE lib9p_srv_read_cr(void *_srv) { sess.closing = true; cr_pause_and_yield(); assert(sess.reqs.len == 0); - netio_close(conn.fd, false, true); + netio_close(conn.fd, true, true); } } @@ -384,6 +385,7 @@ static void handle_Tversion(struct _lib9p_srv_req *ctx, return; } + /* if (ctx->parent_sess->reqs.len) { ctx->parent_sess->closing = true; // TODO: send flush events @@ -398,6 +400,7 @@ static void handle_Tversion(struct _lib9p_srv_req *ctx, fidmap_del(&ctx->parent_sess->fids, fid); } } + */ // TODO: replace session with a new one? #pragma GCC diagnostic push |