]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: ostream-file - Don't try to set TCP options after stream is closed
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 May 2019 20:46:43 +0000 (23:46 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 19 Jun 2019 10:55:28 +0000 (13:55 +0300)
Flushing the buffer could close the stream and the fd.

src/lib/ostream-file.c

index 5456f39bfc2497af73b1e9ea5c46d82ea44d52c1..fcfc8b9090792b88e35e678bb2e2b6eecf4c16b3 100644 (file)
@@ -370,6 +370,10 @@ static void o_stream_file_cork(struct ostream_private *stream, bool set)
                                        stream_send_io, fstream);
                        }
                }
+               if (stream->ostream.closed) {
+                       /* flushing may have closed the stream already */
+                       return;
+               }
 
                if (fstream->socket_cork_set) {
                        i_assert(!set);