- if (!ustream_write_pending(s))
- ustream_fd_set_uloop(s);
- }
-
- if (!s->eof && fd->eof) {
- s->eof = true;
- ustream_fd_set_uloop(s);
- ustream_state_change(s);
+ bool no_more = ustream_write_pending(s);
+ if (no_more)
+ ustream_fd_set_uloop(s, false);