efl_net_socket_fd: do not act if already closed, do not set eos.
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Fri, 28 Oct 2016 00:26:02 +0000 (22:26 -0200)
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Mon, 31 Oct 2016 21:38:22 +0000 (19:38 -0200)
It's pointless to reset eos, if it was set, keep it like that.

src/lib/ecore_con/efl_net_socket_fd.c

index c4c0267..5f3fd03 100644 (file)
@@ -36,19 +36,24 @@ typedef struct _Efl_Net_Socket_Fd_Data
 static void
 _efl_net_socket_fd_event_read(void *data EINA_UNUSED, const Efl_Event *event)
 {
+   if (efl_io_closer_closed_get(event->object))
+     return; // TODO: unregister READ event
    efl_io_reader_can_read_set(event->object, EINA_TRUE);
-   efl_io_reader_eos_set(event->object, EINA_FALSE);
 }
 
 static void
 _efl_net_socket_fd_event_write(void *data EINA_UNUSED, const Efl_Event *event)
 {
+   if (efl_io_closer_closed_get(event->object))
+     return; // TODO: unregister WRITE event
    efl_io_writer_can_write_set(event->object, EINA_TRUE);
 }
 
 static void
 _efl_net_socket_fd_event_error(void *data EINA_UNUSED, const Efl_Event *event)
 {
+   if (efl_io_closer_closed_get(event->object))
+     return; // TODO: unregister ERROR event
    efl_io_writer_can_write_set(event->object, EINA_FALSE);
    efl_io_reader_can_read_set(event->object, EINA_FALSE);
    efl_io_reader_eos_set(event->object, EINA_TRUE);