[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 02/10] iov: handle EOF in iov_send_recv
From: |
MORITA Kazutaka |
Subject: |
[Qemu-devel] [PATCH v3 02/10] iov: handle EOF in iov_send_recv |
Date: |
Thu, 25 Jul 2013 17:31:57 +0900 |
Without this patch, iov_send_recv() never returns when do_send_recv()
returns zero.
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: MORITA Kazutaka <address@hidden>
---
util/iov.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/util/iov.c b/util/iov.c
index cc6e837..f705586 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -202,6 +202,12 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov,
unsigned iov_cnt,
return -1;
}
+ if (ret == 0 && !do_send) {
+ /* recv returns 0 when the peer has performed an orderly
+ * shutdown. */
+ break;
+ }
+
/* Prepare for the next iteration */
offset += ret;
total += ret;
--
1.8.1.3.566.gaa39828
- [Qemu-devel] [PATCH v3 00/10] sheepdog: reconnect server after connection failure, MORITA Kazutaka, 2013/07/25
- [Qemu-devel] [PATCH v3 02/10] iov: handle EOF in iov_send_recv,
MORITA Kazutaka <=
- [Qemu-devel] [PATCH v3 06/10] coroutine: add co_aio_sleep_ns() to allow sleep in block drivers, MORITA Kazutaka, 2013/07/25
- [Qemu-devel] [PATCH v3 10/10] sheepdog: check simultaneous create in resend_aioreq, MORITA Kazutaka, 2013/07/25
- [Qemu-devel] [PATCH v3 08/10] sheepdog: make add_aio_request and send_aioreq void functions, MORITA Kazutaka, 2013/07/25
- [Qemu-devel] [PATCH v3 03/10] sheepdog: check return values of qemu_co_recv/send correctly, MORITA Kazutaka, 2013/07/25
- [Qemu-devel] [PATCH v3 07/10] sheepdog: try to reconnect to sheepdog after network error, MORITA Kazutaka, 2013/07/25