]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If stream is closed without stream_errno set, change it to ECONNRESET so if
authorTimo Sirainen <tss@iki.fi>
Wed, 5 Mar 2008 00:03:50 +0000 (02:03 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 5 Mar 2008 00:03:50 +0000 (02:03 +0200)
there are any future reads they'll return it.

--HG--
branch : HEAD

src/lib/istream.c

index dba348b934157312256dde92ed22b9e7002c4196..cd2c19e7f56179fb957ed059472ed2203897b50d 100644 (file)
@@ -49,6 +49,9 @@ void i_stream_close(struct istream *stream)
 {
        io_stream_close(&stream->real_stream->iostream);
        stream->closed = TRUE;
+
+       if (stream->stream_errno == 0)
+               stream->stream_errno = ECONNRESET;
 }
 
 void i_stream_set_max_buffer_size(struct istream *stream, size_t max_size)