rstream: Pass read count to read events

This is necessary to keep events in the same order received from the OS.
This commit is contained in:
Thiago de Arruda
2015-08-12 19:16:06 -03:00
parent 166d8c799f
commit 6b3cd381dc
7 changed files with 49 additions and 32 deletions

View File

@@ -328,7 +328,8 @@ static void channel_from_stdio(void)
wstream_init_fd(&loop, &channel->data.std.out, 1, 0, NULL);
}
static void forward_stderr(Stream *stream, RBuffer *rbuf, void *data, bool eof)
static void forward_stderr(Stream *stream, RBuffer *rbuf, size_t count,
void *data, bool eof)
{
while (rbuffer_size(rbuf)) {
char buf[256];
@@ -343,7 +344,8 @@ static void process_exit(Process *proc, int status, void *data)
decref(data);
}
static void parse_msgpack(Stream *stream, RBuffer *rbuf, void *data, bool eof)
static void parse_msgpack(Stream *stream, RBuffer *rbuf, size_t c, void *data,
bool eof)
{
Channel *channel = data;
incref(channel);