summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-20 10:12:59 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-20 10:18:33 -0200
commitb00ea12e8b48c3441c60b4d1c17dd93b878c7eef (patch)
tree1007efb8f34dc45942108598a307dbfe3fbc995f /src/lib/ecore_con
parentfd6dbe3393ee9947b3735b50032999862f774694 (diff)
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.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/ecore_con_legacy.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/ecore_con/ecore_con_legacy.c b/src/lib/ecore_con/ecore_con_legacy.c
index 54b929dc53..bfff6d939c 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
539} 539}
540 540
541static void 541static void
542_ecore_con_client_socket_read_finished(void *data, const Efl_Event *event EINA_UNUSED)
543{
544 Ecore_Con_Client *cl = data;
545
546 DBG("client %p socket %p read finished, queue EOS", cl, cl->socket);
547
548 if (!efl_io_closer_closed_get(cl->socket))
549 efl_io_buffered_stream_eos_mark(cl->socket);
550}
551
552static void
542_ecore_con_client_socket_finished(void *data, const Efl_Event *event EINA_UNUSED) 553_ecore_con_client_socket_finished(void *data, const Efl_Event *event EINA_UNUSED)
543{ 554{
544 Ecore_Con_Client *cl = data; 555 Ecore_Con_Client *cl = data;
@@ -567,6 +578,7 @@ _ecore_con_client_socket_error(void *data, const Efl_Event *event)
567EFL_CALLBACKS_ARRAY_DEFINE(_ecore_con_client_socket_cbs, 578EFL_CALLBACKS_ARRAY_DEFINE(_ecore_con_client_socket_cbs,
568 { EFL_IO_BUFFERED_STREAM_EVENT_PROGRESS, _ecore_con_client_socket_progress }, 579 { EFL_IO_BUFFERED_STREAM_EVENT_PROGRESS, _ecore_con_client_socket_progress },
569 { EFL_IO_BUFFERED_STREAM_EVENT_SLICE_CHANGED, _ecore_con_client_socket_slice_changed }, 580 { EFL_IO_BUFFERED_STREAM_EVENT_SLICE_CHANGED, _ecore_con_client_socket_slice_changed },
581 { EFL_IO_BUFFERED_STREAM_EVENT_READ_FINISHED, _ecore_con_client_socket_read_finished },
570 { EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, _ecore_con_client_socket_finished }, 582 { EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, _ecore_con_client_socket_finished },
571 { EFL_IO_BUFFERED_STREAM_EVENT_ERROR, _ecore_con_client_socket_error }); 583 { EFL_IO_BUFFERED_STREAM_EVENT_ERROR, _ecore_con_client_socket_error });
572 584
@@ -1239,6 +1251,17 @@ _ecore_con_server_dialer_progress(void *data, const Efl_Event *event EINA_UNUSED
1239} 1251}
1240 1252
1241static void 1253static void
1254_ecore_con_server_dialer_read_finished(void *data, const Efl_Event *event EINA_UNUSED)
1255{
1256 Ecore_Con_Server *svr = data;
1257
1258 if (svr->delete_me) return;
1259
1260 if (!efl_io_closer_closed_get(svr->dialer))
1261 efl_io_buffered_stream_eos_mark(svr->dialer);
1262}
1263
1264static void
1242_ecore_con_server_dialer_finished(void *data, const Efl_Event *event EINA_UNUSED) 1265_ecore_con_server_dialer_finished(void *data, const Efl_Event *event EINA_UNUSED)
1243{ 1266{
1244 Ecore_Con_Server *svr = data; 1267 Ecore_Con_Server *svr = data;
@@ -1316,6 +1339,7 @@ _ecore_con_server_dialer_connected(void *data, const Efl_Event *event EINA_UNUSE
1316EFL_CALLBACKS_ARRAY_DEFINE(_ecore_con_server_dialer_cbs, 1339EFL_CALLBACKS_ARRAY_DEFINE(_ecore_con_server_dialer_cbs,
1317 { EFL_IO_BUFFERED_STREAM_EVENT_PROGRESS, _ecore_con_server_dialer_progress }, 1340 { EFL_IO_BUFFERED_STREAM_EVENT_PROGRESS, _ecore_con_server_dialer_progress },
1318 { EFL_IO_BUFFERED_STREAM_EVENT_SLICE_CHANGED, _ecore_con_server_dialer_slice_changed }, 1341 { EFL_IO_BUFFERED_STREAM_EVENT_SLICE_CHANGED, _ecore_con_server_dialer_slice_changed },
1342 { EFL_IO_BUFFERED_STREAM_EVENT_READ_FINISHED, _ecore_con_server_dialer_read_finished },
1319 { EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, _ecore_con_server_dialer_finished }, 1343 { EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, _ecore_con_server_dialer_finished },
1320 { EFL_NET_DIALER_EVENT_ERROR, _ecore_con_server_dialer_error }, 1344 { EFL_NET_DIALER_EVENT_ERROR, _ecore_con_server_dialer_error },
1321 { EFL_NET_DIALER_EVENT_RESOLVED, _ecore_con_server_dialer_resolved }, 1345 { EFL_NET_DIALER_EVENT_RESOLVED, _ecore_con_server_dialer_resolved },