}
if (!len) {
+ if (!s->eof)
+ ustream_state_change(s);
s->eof = true;
- ustream_state_change(s);
ustream_fd_set_uloop(s, false);
return;
}
ustream_fd_read_pending(sf, &more);
if (events & ULOOP_WRITE) {
- if (!ustream_write_pending(s))
+ if (ustream_write_pending(s))
ustream_fd_set_uloop(s, false);
}