Browse Source

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
Felix von Leitner 6 months ago
parent
commit
52d9cfa681
  1. 2
      io/io_eagain.c
  2. 2
      io/io_eagain_write.c
  3. 5
      io/iob_send.c

2
io/io_eagain.c

@ -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

2
io/io_eagain_write.c

@ -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

5
io/iob_send.c

@ -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