diff --git a/io/iob_write.c b/io/iob_write.c index c7a184b..9321875 100644 --- a/io/iob_write.c +++ b/io/iob_write.c @@ -11,7 +11,7 @@ int64 iob_write2(int64 s,io_batch* b,io_write_callback cb,io_sendfile_callback s total=0; if (!(e=array_get(&b->b,sizeof(iob_entry),b->next))) return -3; /* can't happen error */ - for (i=b->next; e+inext; } - if (total == b->bytesleft) + if (b->bytesleft == 0) iob_reset(b); return total; }