[SCM] Samba Shared Repository - branch master updated -
release-4-0-0alpha7-1749-gedd9bd9
Stefan Metzmacher
metze at samba.org
Fri May 22 12:02:17 GMT 2009
The branch, master has been updated
via edd9bd9b167cb04290b06eb9b209c21ad5a884a0 (commit)
from e9010fa366746ec1ae948dbcf3493d446e23b14c (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit edd9bd9b167cb04290b06eb9b209c21ad5a884a0
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 22 12:28:17 2009 +0200
tsocket: allow empty vectors at the end for tstream_writev()/readv()
metze
-----------------------------------------------------------------------
Summary of changes:
lib/tsocket/tsocket_bsd.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c
index 8f5f009..a4cbda8 100644
--- a/lib/tsocket/tsocket_bsd.c
+++ b/lib/tsocket/tsocket_bsd.c
@@ -1538,6 +1538,19 @@ static void tstream_bsd_readv_handler(void *private_data)
state->count -= 1;
}
+ /*
+ * there're maybe some empty vectors at the end
+ * which we need to skip, otherwise we would get
+ * ret == 0 from the readv() call and return EPIPE
+ */
+ while (state->count > 0) {
+ if (state->vector[0].iov_len > 0) {
+ break;
+ }
+ state->vector += 1;
+ state->count -= 1;
+ }
+
if (state->count > 0) {
/* we have more to read */
return;
@@ -1685,6 +1698,19 @@ static void tstream_bsd_writev_handler(void *private_data)
state->count -= 1;
}
+ /*
+ * there're maybe some empty vectors at the end
+ * which we need to skip, otherwise we would get
+ * ret == 0 from the writev() call and return EPIPE
+ */
+ while (state->count > 0) {
+ if (state->vector[0].iov_len > 0) {
+ break;
+ }
+ state->vector += 1;
+ state->count -= 1;
+ }
+
if (state->count > 0) {
/* we have more to read */
return;
--
Samba Shared Repository
More information about the samba-cvs
mailing list