Fix check for an empty output buffer and limit to flist_eof.
authorWayne Davison <wayned@samba.org>
Sat, 17 Oct 2009 16:09:27 +0000 (09:09 -0700)
committerWayne Davison <wayned@samba.org>
Sat, 17 Oct 2009 18:06:20 +0000 (11:06 -0700)
io.c

diff --git a/io.c b/io.c
index 7c50d5a..610a802 100644 (file)
--- a/io.c
+++ b/io.c
@@ -1197,7 +1197,8 @@ void io_end_buffering_out(BOOL free_buffers)
 
 void maybe_flush_socket(int important)
 {
-       if (iobuf.out.buf && iobuf.out.len && (important || time(NULL) - last_io_out >= 5))
+       if (flist_eof && iobuf.out.buf && iobuf.out.len > iobuf.out_empty_len
+        && (important || time(NULL) - last_io_out >= 5))
                io_flush(NORMAL_FLUSH);
 }