ostream.c revision 5df4dbc38d7b7d54cba35a2c258366e1d4bac3c8
/* Copyright (c) 2002-2017 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream.h"
#include "ostream-private.h"
{
}
{
return "";
}
}
{
}
{
struct ostream *s;
/* we'll only return errors for streams that have stream_errno set.
we might be returning unintended error otherwise. */
if (stream->stream_errno == 0)
return "<no error>";
if (s->stream_errno == 0)
break;
}
}
{
/* Ideally o_stream_finish() would be called for all non-failed
ostreams, but strictly requiring it would cause unnecessary
complexity for many callers. Just require that at this point
after flushing there isn't anything in the output buffer or that
we're ignoring all errors. */
if (o_stream_flush(stream) == 0)
/* first mark the stream as being closed so the
o_stream_copy_error_from_parent() won't recurse us back
here. but don't immediately mark the stream closed, because
we may still want to write something to it. */
}
if (stream->stream_errno == 0)
}
{
return;
}
{
}
{
return;
i_panic("output stream %s is missing error handling",
}
}
{
}
void (*callback)())
{
callback);
}
{
}
void *context)
{
}
{
}
{
}
{
}
{
return;
}
{
return;
}
{
}
{
int ret = 1;
return -1;
}
return -1;
}
}
return ret;
}
{
return;
}
{
}
{
}
{
return -1;
}
return -1;
}
return 1;
}
{
struct const_iovec iov;
}
static ssize_t
unsigned int iov_count, bool *overflow_r)
{
unsigned int i;
*overflow_r = FALSE;
for (i = 0, total_size = 0; i < iov_count; i++)
if (total_size == 0)
return 0;
if (ret < 0) {
} else {
*overflow_r = TRUE;
}
}
return ret;
}
unsigned int iov_count)
{
bool overflow;
return -1;
}
}
{
}
{
struct const_iovec iov;
}
unsigned int iov_count)
{
bool overflow;
return;
if (overflow)
}
{
}
{
return o_stream_flush(stream);
}
{
}
}
{
}
{
}
}
switch (res) {
break;
break;
break;
return res;
return res;
}
/* non-failure - make sure stream offsets match */
return res;
}
{
break;
i_unreached();
break;
"nsend-istream: read(%s) failed: %s",
break;
break;
}
}
{
int ret;
return -1;
}
}
return ret;
}
{
struct const_iovec iov;
const unsigned char *data;
else if (ret == 0)
}
if (instream->stream_errno != 0)
}
{
}
bool close_parent)
{
}
{
}
static void
{
}
{
if (set) {
} else {
}
}
{
}
{
/* we already have quite a lot of data in parent stream.
unless we can flush it, don't add any more to it or we
could keep wasting memory by just increasing the buffer
size all the time. */
return -1;
}
return 0;
}
return 1;
}
{
int ret;
else
if (ret < 0)
return ret;
}
{
int ret;
return 1;
return ret;
}
static void
void *context)
{
}
static void
{
}
static size_t
{
return 0;
else
}
static int
{
return -1;
}
static ssize_t
{
return -1;
}
return ret;
}
static int
const void *data ATTR_UNUSED,
{
return -1;
}
static enum ostream_send_istream_result
{
}
{
}
struct ostream *
{
}
}
}
}
{
struct ostream_private *stream;
return output;
}
struct ostream *
{
return output;
}
{
struct ostream_private *stream;
}