From a7657e821f81eab59a719c81d3994194492476a6 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Mon, 19 Dec 2016 12:57:09 -0200 Subject: ecore_con/ecore_ipc: flush should wait for connection. Some applications will create the handle, immediately send data, flush and delete it, expecting the data to be sent to remote peer. This is a bad behavior as the application would become unresponsive until the connection is established, data can be written (since depends on server consuming it), then allow it to be closed. A proper behavior here would be to chain based on events, with the usage of a copier would be simply wait for "done" event. However the legacy API allowed this and terminology depends on this awkward "feature", thus be bug-compatible. This fixes T5015. --- src/lib/ecore_ipc/ecore_ipc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib/ecore_ipc') diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c index 40a1e1e8a7..ec83de76f5 100644 --- a/src/lib/ecore_ipc/ecore_ipc.c +++ b/src/lib/ecore_ipc/ecore_ipc.c @@ -1182,6 +1182,9 @@ ecore_ipc_server_flush(Ecore_Ipc_Server *svr) } if (svr->dialer.input) { + while (!efl_io_closer_closed_get(svr->dialer.dialer) && + !efl_net_dialer_connected_get(svr->dialer.dialer)) + ecore_main_loop_iterate(); while (efl_io_queue_usage_get(svr->dialer.input) > 0) efl_io_copier_flush(svr->dialer.send_copier, EINA_TRUE, EINA_TRUE); return; -- cgit v1.2.1