buf->p += n;
}
-/* Schedule all remaining buffer data to be sent. ->o is not touched if it
- * already covers those data. That permits doing a flush even after a forward,
- * although not recommended.
- */
-static inline void buffer_flush(struct buffer *buf)
-{
- buf->p = buffer_wrap_add(buf, buf->p + buf->i);
- buf->o += buf->i;
- buf->i = 0;
-}
-
/* This function writes the string <str> at position <pos> which must be in
* buffer <b>, and moves <end> just after the end of <str>. <b>'s parameters
* (l, r, lr) are updated to be valid after the shift. the shift value
channel_auto_read(req);
channel_auto_connect(req);
channel_auto_close(req);
- buffer_flush(req->buf);
+ c_adv(req, ci_data(req));
/* We'll let data flow between the producer (if still connected)
* to the consumer (which might possibly not be connected yet).
*/
channel_auto_read(res);
channel_auto_close(res);
- buffer_flush(res->buf);
+ c_adv(res, ci_data(res));
/* We'll let data flow between the producer (if still connected)
* to the consumer.