From fd6dbe3393ee9947b3735b50032999862f774694 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Tue, 20 Dec 2016 10:11:21 -0200 Subject: [PATCH] efl_io_buffered_stream: eos-mark and flush sender on close. By marking EOS on the outgoing queue we allow the sender to flush pending data if that's possible. This also fixes a typo in the condition for eos_mark, it operates on outgoing, not incoming queue. --- src/lib/ecore/efl_io_buffered_stream.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore/efl_io_buffered_stream.c b/src/lib/ecore/efl_io_buffered_stream.c index ce6411bc5d..ab26bf453e 100644 --- a/src/lib/ecore/efl_io_buffered_stream.c +++ b/src/lib/ecore/efl_io_buffered_stream.c @@ -192,6 +192,12 @@ _efl_io_buffered_stream_efl_io_closer_close(Eo *o, Efl_Io_Buffered_Stream_Data * EINA_SAFETY_ON_TRUE_RETURN_VAL(pd->closed, EINVAL); + if (pd->outgoing) + { + efl_io_queue_eos_mark(pd->outgoing); + efl_io_copier_flush(pd->sender, EINA_FALSE, EINA_TRUE); + } + /* line delimiters may be holding a last chunk of data */ if (pd->receiver) efl_io_copier_flush(pd->receiver, EINA_FALSE, EINA_TRUE); @@ -561,7 +567,7 @@ _efl_io_buffered_stream_clear(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd EOLIAN static void _efl_io_buffered_stream_eos_mark(Eo *o, Efl_Io_Buffered_Stream_Data *pd) { - if (!pd->incoming) return; + if (!pd->outgoing) return; DBG("%p mark eos", o); efl_io_queue_eos_mark(pd->outgoing); }