fix case where iob_send sends all from io batch, but then new data is

added and iob_send is called again
master
leitner 21 years ago
parent 523f6f4765
commit f4108178f2

@ -107,16 +107,17 @@ eagain:
else else
return total?total:sent; return total?total:sent;
if (sent==b->bytesleft) { if (sent==b->bytesleft) {
b->bytesleft=0;
#ifdef TCP_CORK #ifdef TCP_CORK
if (b->bufs && b->files) { if (b->bufs && b->files) {
static int zero=0; static int zero=0;
setsockopt(s,IPPROTO_TCP,TCP_CORK,&zero,sizeof(zero)); setsockopt(s,IPPROTO_TCP,TCP_CORK,&zero,sizeof(zero));
} }
#endif #endif
iob_reset(b);
break; break;
} else if (sent>0) { } else if (sent>0) {
int64 rest=sent; int64 rest=sent;
b->bytesleft-=rest; b->bytesleft-=rest;
for (i=0; e+i<last; ++i) { for (i=0; e+i<last; ++i) {
if (e[i].n<=rest) { if (e[i].n<=rest) {

Loading…
Cancel
Save