efl_io_buffered_stream: if there is a copier, check if it's done.
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Mon, 19 Dec 2016 23:43:56 +0000 (21:43 -0200)
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Tue, 20 Dec 2016 12:18:32 +0000 (10:18 -0200)
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.

src/lib/ecore/efl_io_buffered_stream.c

index 3b7b4d2..ce6411b 100644 (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)
           {