istream-concat.c revision 0536ccb51d41e3078c3a9fa33e509fb4b2420f95
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync/* Copyright (c) 2007-2011 Dovecot authors, see the included COPYING file */
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsyncstatic void i_stream_concat_close(struct iostream_private *stream)
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync struct concat_istream *cstream = (struct concat_istream *)stream;
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync unsigned int i;
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsyncstatic void i_stream_concat_destroy(struct iostream_private *stream)
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync struct concat_istream *cstream = (struct concat_istream *)stream;
f32de6c198a491c28ace2b4c53f8d04a79fd6d69vboxsync unsigned int i;
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsynci_stream_concat_set_max_buffer_size(struct iostream_private *stream,
57b49c1557a310ee615bc0ee79dd2a2e92319a1bvboxsync struct concat_istream *cstream = (struct concat_istream *)stream;
57b49c1557a310ee615bc0ee79dd2a2e92319a1bvboxsync unsigned int i;
04ee5d908f45a7883257fa7e40fb42bbdbaf24b9vboxsync i_stream_set_max_buffer_size(cstream->input[i], max_size);
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsyncstatic void i_stream_concat_read_next(struct concat_istream *cstream)
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync const unsigned char *data;
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync data = i_stream_get_data(cstream->cur_input, &data_size);
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync cstream->cur_input = cstream->input[cstream->cur_idx];
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync if (cstream->prev_stream_left > 0 || cstream->istream.pos == 0) {
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync /* we already verified that the data size is less than the
d46ee884c41b808b239563b1978468aae12e33a2vboxsync maximum buffer size */
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync memcpy(cstream->istream.w_buffer, data, data_size);
04ee5d908f45a7883257fa7e40fb42bbdbaf24b9vboxsyncstatic ssize_t i_stream_concat_read(struct istream_private *stream)
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync struct concat_istream *cstream = (struct concat_istream *)stream;
96c4ae4f195842fce91fb4749faeb7f31a3cb9c6vboxsync const unsigned char *data;
bool last_stream;
bytes_skipped = 0;
ret = 0;
return ret;
return ret;
if (*v_offset == 0) {
static const struct stat *
unsigned int count;