ostream.c revision 34d5077c37dc6224a2d430a72ae51a3f38e9e4f6
/* 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;
}
}
{
/* 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)
}
{
}
{
}
}
{
}
{
}
}
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;
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;
}