in io_eagain, make sure the kernel knows we wanted to write to the

descriptor in case we optimized the syscall away previously
in iob_send leave loop if we got a partial write
master
leitner 4 years ago
parent f84ff9a817
commit 45f99bbd0a

@ -5,6 +5,8 @@ void io_eagain(int64 d) {
if (e) {
if (e->wantread) e->canread=0;
if (e->wantwrite) e->canwrite=0;
if (e->wantwrite && !e->kernelwantwrite)
io_wantwrite(d);
#if defined(HAVE_SIGIO)
if (d==alt_curread) {
#if 0

@ -4,6 +4,8 @@ void io_eagain_write(int64 d) {
io_entry* e=iarray_get(&io_fds,d);
if (e) {
e->canwrite=0;
if (e->wantwrite && !e->kernelwantwrite)
io_wantwrite(d);
#if defined(HAVE_SIGIO)
if (d==alt_curwrite) {
#if 0

@ -286,13 +286,13 @@ eagain:
io_eagain_write(s);
return -1;
}
sent = totalsent;
// fall through
}
// actual error
break;
}
// if we get here, we wrote it all
// if we get here, we wrote it all or we got an EAGAIN after
// writing something. Treat as regular partial write.
sent = totalsent;
} else
sent=sendmsg(s,&msg,MSG_MORE|ZEROCOPY);
@ -354,6 +354,7 @@ eagain:
}
}
io_eagain_write(s);
return total;
} else break;
}
abort:

Loading…
Cancel
Save