ostream-metawrap.c revision 6759ba36f2bac9e83547cfdcf233382a139f1283
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3Timo Sirainen/* Copyright (c) 2013 Dovecot authors, see the included COPYING file */
2eccb2637d0153bb7f9ad39a70f254cece74342cTimo Sirainen void (*write_callback)(void *);
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainenstatic void o_stream_metawrap_call_callback(struct metawrap_ostream *mstream)
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen void (*write_callback)(void *) = mstream->write_callback;
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Siraineno_stream_metawrap_sendv(struct ostream_private *stream,
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen const struct const_iovec *iov, unsigned int iov_count)
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen struct metawrap_ostream *mstream = (struct metawrap_ostream *)stream;
86bdb644d147a73df85abce4325254d694217a5fTimo Sirainen if ((ret = o_stream_sendv(stream->parent, iov, iov_count)) < 0)
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Siraineno_stream_metawrap_send_istream(struct ostream_private *_outstream,
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen if ((ret = o_stream_send_istream(_outstream->parent, instream)) < 0)
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Siraineno_stream_create_metawrap(struct ostream *output,
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen void (*write_callback)(void *), void *context)
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen mstream->ostream.sendv = o_stream_metawrap_sendv;
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen mstream->ostream.send_istream = o_stream_metawrap_send_istream;