barbieri pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b00ea12e8b48c3441c60b4d1c17dd93b878c7eef

commit b00ea12e8b48c3441c60b4d1c17dd93b878c7eef
Author: Gustavo Sverzut Barbieri <barbi...@profusion.mobi>
Date:   Tue Dec 20 10:12:59 2016 -0200

    ecore_con_legacy: fix compatibility behavior (eos-mark on receiver done).
    
    While a socket can be closed to receive data resulting in EOS, it
    could still be used to send stuff. Then it won't result in "finished",
    just "read,finished" event.
    
    However, previously this was considered a disconnect and we must
    respect this otherwise tests (Ecore_Con_Eet suite) will hang waiting
    for a disconnect.
---
 src/lib/ecore_con/ecore_con_legacy.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/lib/ecore_con/ecore_con_legacy.c 
b/src/lib/ecore_con/ecore_con_legacy.c
index 54b929d..bfff6d9 100644
--- a/src/lib/ecore_con/ecore_con_legacy.c
+++ b/src/lib/ecore_con/ecore_con_legacy.c
@@ -539,6 +539,17 @@ _ecore_con_client_socket_slice_changed(void *data, const 
Efl_Event *event EINA_U
 }
 
 static void
+_ecore_con_client_socket_read_finished(void *data, const Efl_Event *event 
EINA_UNUSED)
+{
+   Ecore_Con_Client *cl = data;
+
+   DBG("client %p socket %p read finished, queue EOS", cl, cl->socket);
+
+   if (!efl_io_closer_closed_get(cl->socket))
+     efl_io_buffered_stream_eos_mark(cl->socket);
+}
+
+static void
 _ecore_con_client_socket_finished(void *data, const Efl_Event *event 
EINA_UNUSED)
 {
    Ecore_Con_Client *cl = data;
@@ -567,6 +578,7 @@ _ecore_con_client_socket_error(void *data, const Efl_Event 
*event)
 EFL_CALLBACKS_ARRAY_DEFINE(_ecore_con_client_socket_cbs,
                            { EFL_IO_BUFFERED_STREAM_EVENT_PROGRESS, 
_ecore_con_client_socket_progress },
                            { EFL_IO_BUFFERED_STREAM_EVENT_SLICE_CHANGED, 
_ecore_con_client_socket_slice_changed },
+                           { EFL_IO_BUFFERED_STREAM_EVENT_READ_FINISHED, 
_ecore_con_client_socket_read_finished },
                            { EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, 
_ecore_con_client_socket_finished },
                            { EFL_IO_BUFFERED_STREAM_EVENT_ERROR, 
_ecore_con_client_socket_error });
 
@@ -1239,6 +1251,17 @@ _ecore_con_server_dialer_progress(void *data, const 
Efl_Event *event EINA_UNUSED
 }
 
 static void
+_ecore_con_server_dialer_read_finished(void *data, const Efl_Event *event 
EINA_UNUSED)
+{
+   Ecore_Con_Server *svr = data;
+
+   if (svr->delete_me) return;
+
+   if (!efl_io_closer_closed_get(svr->dialer))
+     efl_io_buffered_stream_eos_mark(svr->dialer);
+}
+
+static void
 _ecore_con_server_dialer_finished(void *data, const Efl_Event *event 
EINA_UNUSED)
 {
    Ecore_Con_Server *svr = data;
@@ -1316,6 +1339,7 @@ _ecore_con_server_dialer_connected(void *data, const 
Efl_Event *event EINA_UNUSE
 EFL_CALLBACKS_ARRAY_DEFINE(_ecore_con_server_dialer_cbs,
                            { EFL_IO_BUFFERED_STREAM_EVENT_PROGRESS, 
_ecore_con_server_dialer_progress },
                            { EFL_IO_BUFFERED_STREAM_EVENT_SLICE_CHANGED, 
_ecore_con_server_dialer_slice_changed },
+                           { EFL_IO_BUFFERED_STREAM_EVENT_READ_FINISHED, 
_ecore_con_server_dialer_read_finished },
                            { EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, 
_ecore_con_server_dialer_finished },
                            { EFL_NET_DIALER_EVENT_ERROR, 
_ecore_con_server_dialer_error },
                            { EFL_NET_DIALER_EVENT_RESOLVED, 
_ecore_con_server_dialer_resolved },

-- 


Reply via email to