efl_io_buffered_stream: if there is a copier, check if it's done.

Before we're exiting if there was nothing pending, but in some cases
this was too aggressive as the copier's source may be alive (ie:
not-EOS), however nothing was read to its internal buffer, thus no
pending.

Since the copier will track its source's EOS, just check if it's done.
This commit is contained in:
Gustavo Sverzut Barbieri 2016-12-19 21:43:56 -02:00
parent 829d1d71fb
commit 4d5105afeb
1 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ _efl_io_buffered_stream_sender_done(void *data, const Efl_Event *event EINA_UNUS
efl_ref(o);
efl_event_callback_call(o, EFL_IO_BUFFERED_STREAM_EVENT_PROGRESS, NULL);
efl_event_callback_call(o, EFL_IO_BUFFERED_STREAM_EVENT_WRITE_FINISHED, NULL);
if ((pending == 0) || efl_io_copier_done_get(pd->receiver))
if ((!pd->receiver) || efl_io_copier_done_get(pd->receiver))
{
if (!pd->is_finished)
{
@ -294,7 +294,7 @@ _efl_io_buffered_stream_efl_io_reader_eos_set(Eo *o, Efl_Io_Buffered_Stream_Data
efl_event_callback_call(o, EFL_IO_BUFFERED_STREAM_EVENT_PROGRESS, NULL);
efl_event_callback_call(o, EFL_IO_READER_EVENT_EOS, NULL);
efl_event_callback_call(o, EFL_IO_BUFFERED_STREAM_EVENT_READ_FINISHED, NULL);
if ((pending == 0) || efl_io_copier_done_get(pd->sender))
if ((!pd->sender) || efl_io_copier_done_get(pd->sender))
{
if (!pd->is_finished)
{