dovecot-2.0-sslstream: ostream: Added default failure handling i...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 03:00:46 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/174275bcb1a5
changeset: 10642:174275bcb1a5
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Feb 06 01:06:47 2010 +0200
description:
ostream: Added default failure handling if write_at() isn't implemented.

diffstat:

1 file changed, 5 insertions(+)
src/lib/ostream.c |    5 +++++

diffs (15 lines):

diff -r b87a15fc462a -r 174275bcb1a5 src/lib/ostream.c
--- a/src/lib/ostream.c	Sat Feb 06 00:38:04 2010 +0200
+++ b/src/lib/ostream.c	Sat Feb 06 01:06:47 2010 +0200
@@ -212,6 +212,11 @@ int o_stream_pwrite(struct ostream *stre
 	if (unlikely(stream->closed))
 		return -1;
 
+	if (stream->real_stream->write_at == NULL) {
+		/* stream doesn't support seeking */
+		stream->stream_errno = EPIPE;
+		return -1;
+	}
 	ret = stream->real_stream->write_at(stream->real_stream,
 					    data, size, offset);
 	if (unlikely(ret < 0)) {


More information about the dovecot-cvs mailing list