dovecot-2.2: istreams: Set (file), (fd) or (buffer) as default n...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 29 08:01:25 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/69334bf138cf
changeset: 14697:69334bf138cf
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 29 07:56:02 2012 +0300
description:
istreams: Set (file), (fd) or (buffer) as default name for those input streams.

diffstat:

 src/lib/istream-data.c   |  1 +
 src/lib/istream-file.c   |  5 ++++-
 src/lib/ostream-buffer.c |  5 ++++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diffs (52 lines):

diff -r b1a0e44e1dac -r 69334bf138cf src/lib/istream-data.c
--- a/src/lib/istream-data.c	Thu Jun 28 09:28:05 2012 +0300
+++ b/src/lib/istream-data.c	Fri Jun 29 07:56:02 2012 +0300
@@ -33,5 +33,6 @@
 	stream->istream.seekable = TRUE;
 	i_stream_create(stream, NULL, -1);
 	stream->statbuf.st_size = size;
+	i_stream_set_name(&stream->istream, "(buffer)");
 	return &stream->istream;
 }
diff -r b1a0e44e1dac -r 69334bf138cf src/lib/istream-file.c
--- a/src/lib/istream-file.c	Thu Jun 28 09:28:05 2012 +0300
+++ b/src/lib/istream-file.c	Fri Jun 29 07:56:02 2012 +0300
@@ -171,6 +171,7 @@
 i_stream_create_file_common(int fd, size_t max_buffer_size, bool autoclose_fd)
 {
 	struct file_istream *fstream;
+	struct istream *input;
 	struct stat st;
 	bool is_file;
 
@@ -206,7 +207,9 @@
 	}
 	fstream->istream.istream.readable_fd = TRUE;
 
-	return i_stream_create(&fstream->istream, NULL, fd);
+	input = i_stream_create(&fstream->istream, NULL, fd);
+	i_stream_set_name(input, is_file ? "(file)" : "(fd)");
+	return input;
 }
 
 struct istream *i_stream_create_fd(int fd, size_t max_buffer_size,
diff -r b1a0e44e1dac -r 69334bf138cf src/lib/ostream-buffer.c
--- a/src/lib/ostream-buffer.c	Thu Jun 28 09:28:05 2012 +0300
+++ b/src/lib/ostream-buffer.c	Fri Jun 29 07:56:02 2012 +0300
@@ -51,6 +51,7 @@
 struct ostream *o_stream_create_buffer(buffer_t *buf)
 {
 	struct buffer_ostream *bstream;
+	struct ostream *output;
 
 	bstream = i_new(struct buffer_ostream, 1);
 	bstream->ostream.max_buffer_size = (size_t)-1;
@@ -59,5 +60,7 @@
 	bstream->ostream.write_at = o_stream_buffer_write_at;
 
 	bstream->buf = buf;
-	return o_stream_create(&bstream->ostream, NULL);
+	output = o_stream_create(&bstream->ostream, NULL);
+	o_stream_set_name(output, "(buffer)");
+	return output;
 }


More information about the dovecot-cvs mailing list