/* Copyright (c) 2017-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "array.h"
#include "istream-private.h"
#include "istream-multiplex.h"
/* all multiplex packets are [1 byte cid][4 byte length][data] */
struct multiplex_istream;
struct multiplex_ichannel {
};
struct multiplex_istream {
/* channel 0 is main channel */
unsigned int remain;
};
static struct multiplex_ichannel *
{
return *channelp;
}
return NULL;
}
{
}
{
continue;
"Unexpected EOF - %u bytes remaining in packet",
}
}
}
static ssize_t
struct multiplex_ichannel *req_channel)
{
const unsigned char *data;
return -1;
}
return -1;
}
return ret;
}
for(;;) {
if (len == 0) {
/* can't return 0 with blocking istreams,
so try again from the beginning. */
}
break;
}
/* is it open? */
if (!alloc_ret) {
return 0;
if (got > 0)
break;
return -2;
}
/* dump into buffer */
} else {
}
} else {
}
/* see if there is more to read */
continue;
}
/* need more data */
if (len < 5) {
if (ret > 0)
break;
}
/* channel ID */
/* data length */
}
}
return got;
}
{
/* if previous multiplex read dumped data for us
actually serve it here. */
if (channel->pending_pos > 0) {
channel->pending_pos = 0;
return ret;
}
}
static void
{
}
static void
{
if (close_parent) {
return;
}
}
{
/* can't do anything until they are all closed */
return;
}
{
break;
}
}
}
static struct istream *
{
if (cid == 0)
else
}
{
}
{
return i_stream_add_channel_real(mstream, 0);
}
{
}