ostream-escaped.c revision 8109f3187f5ece5565de1813209af42dc7bb768b
/* Copyright (c) 2016-2017 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "ostream.h"
#include "ostream-private.h"
#include "ostream-escaped.h"
struct escaped_ostream {
struct ostream_private ostream;
bool flushed;
};
static ssize_t
{
return 1; /* nothing to send */
if (ret < 0) {
return -1;
}
/* move data */
return 0;
}
return 1;
}
static ssize_t
{
if (max_buffer_size > IO_BLOCK_SIZE) {
/* avoid using up too much memory in case of large buffers */
}
for (i = 0; i < len; i++) {
if (ret < 0) {
return ret;
}
if (ret == 0)
break;
}
}
return i;
}
static ssize_t
{
unsigned int iov_cur;
if (ret < 0)
return ret;
break;
}
if (o_stream_escaped_send_outbuf(estream) < 0)
return -1;
return bytes;
}
static int
{
int ret;
return ret;
return o_stream_flush_parent(stream);
}
{
}
{
}
struct ostream *
{
struct escaped_ostream *estream;
}