Commit c7b92c90 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Try harder to fix solaris IOV_MAX related issue.

parent c888c08d
...@@ -179,14 +179,16 @@ WRW_Write(struct worker *w, const void *ptr, int len) ...@@ -179,14 +179,16 @@ WRW_Write(struct worker *w, const void *ptr, int len)
return (0); return (0);
if (len == -1) if (len == -1)
len = strlen(ptr); len = strlen(ptr);
if (wrw->niov == wrw->siov + (wrw->ciov < wrw->siov ? 1 : 0)) if (wrw->niov >= wrw->siov - (wrw->ciov < wrw->siov ? 1 : 0))
(void)WRW_Flush(w); (void)WRW_Flush(w);
wrw->iov[wrw->niov].iov_base = TRUST_ME(ptr); wrw->iov[wrw->niov].iov_base = TRUST_ME(ptr);
wrw->iov[wrw->niov].iov_len = len; wrw->iov[wrw->niov].iov_len = len;
wrw->liov += len; wrw->liov += len;
if (wrw->ciov < wrw->siov)
wrw->cliov += len;
wrw->niov++; wrw->niov++;
if (wrw->ciov < wrw->siov) {
assert(wrw->niov < wrw->siov);
wrw->cliov += len;
}
return (len); return (len);
} }
...@@ -208,6 +210,7 @@ WRW_Chunked(struct worker *w) ...@@ -208,6 +210,7 @@ WRW_Chunked(struct worker *w)
wrw->ciov = wrw->niov++; wrw->ciov = wrw->niov++;
wrw->cliov = 0; wrw->cliov = 0;
assert(wrw->ciov < wrw->siov); assert(wrw->ciov < wrw->siov);
assert(wrw->niov < wrw->siov);
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment