summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-20 10:11:21 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-20 10:18:33 -0200
commitfd6dbe3393ee9947b3735b50032999862f774694 (patch)
treefd6f357f2a00014256b39a29ad6e2476e2c0d665 /src
parentc152aad8c5770b0ba260e398680ccdade96d3128 (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/lib/ecore/efl_io_buffered_stream.c8
1 files changed, 7 insertions, 1 deletions
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 *
192 192
193 EINA_SAFETY_ON_TRUE_RETURN_VAL(pd->closed, EINVAL); 193 EINA_SAFETY_ON_TRUE_RETURN_VAL(pd->closed, EINVAL);
194 194
195 if (pd->outgoing)
196 {
197 efl_io_queue_eos_mark(pd->outgoing);
198 efl_io_copier_flush(pd->sender, EINA_FALSE, EINA_TRUE);
199 }
200
195 /* line delimiters may be holding a last chunk of data */ 201 /* line delimiters may be holding a last chunk of data */
196 if (pd->receiver) efl_io_copier_flush(pd->receiver, EINA_FALSE, EINA_TRUE); 202 if (pd->receiver) efl_io_copier_flush(pd->receiver, EINA_FALSE, EINA_TRUE);
197 203
@@ -561,7 +567,7 @@ _efl_io_buffered_stream_clear(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd
561EOLIAN static void 567EOLIAN static void
562_efl_io_buffered_stream_eos_mark(Eo *o, Efl_Io_Buffered_Stream_Data *pd) 568_efl_io_buffered_stream_eos_mark(Eo *o, Efl_Io_Buffered_Stream_Data *pd)
563{ 569{
564 if (!pd->incoming) return; 570 if (!pd->outgoing) return;
565 DBG("%p mark eos", o); 571 DBG("%p mark eos", o);
566 efl_io_queue_eos_mark(pd->outgoing); 572 efl_io_queue_eos_mark(pd->outgoing);
567} 573}