forked from enlightenment/efl
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.
This commit is contained in:
parent
c152aad8c5
commit
fd6dbe3393
|
@ -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);
|
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 */
|
/* line delimiters may be holding a last chunk of data */
|
||||||
if (pd->receiver) efl_io_copier_flush(pd->receiver, EINA_FALSE, EINA_TRUE);
|
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
|
EOLIAN static void
|
||||||
_efl_io_buffered_stream_eos_mark(Eo *o, Efl_Io_Buffered_Stream_Data *pd)
|
_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);
|
DBG("%p mark eos", o);
|
||||||
efl_io_queue_eos_mark(pd->outgoing);
|
efl_io_queue_eos_mark(pd->outgoing);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue