From 842d0011292325b264c07449475f0de0cb312688 Mon Sep 17 00:00:00 2001 From: "L. Pereira" Date: Thu, 23 May 2024 08:43:32 -0700 Subject: [PATCH] More fixes to I/O unification stuff --- src/lib/lwan-io-wrappers.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/lwan-io-wrappers.c b/src/lib/lwan-io-wrappers.c index 5eb09b539..6084f0a3d 100644 --- a/src/lib/lwan-io-wrappers.c +++ b/src/lib/lwan-io-wrappers.c @@ -78,11 +78,11 @@ ssize_t lwan_writev_fd(struct lwan_request *request, curr_iov++; } - iov[curr_iov].iov_base = (char *)iov[curr_iov].iov_base + written; - iov[curr_iov].iov_len -= (size_t)written; - if (curr_iov == iov_count) return total_written; + + iov[curr_iov].iov_base = (char *)iov[curr_iov].iov_base + written; + iov[curr_iov].iov_len -= (size_t)written; } lwan_request_await_read(request, fd); @@ -134,12 +134,12 @@ ssize_t lwan_readv_fd(struct lwan_request *request, curr_iov++; } + if (curr_iov == iov_count) + return total_bytes_read; + iov[curr_iov].iov_base = (char *)iov[curr_iov].iov_base + bytes_read; iov[curr_iov].iov_len -= (size_t)bytes_read; - - if (curr_iov == iov_count) - return total_bytes_read; } lwan_request_await_read(request, fd);