summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-19 12:57:09 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-19 13:03:33 -0200
commita7657e821f81eab59a719c81d3994194492476a6 (patch)
tree7e0a48ab43b60925301e5f7f86c75b6030e6c689
parentfe668ef52c74f52c45d1c0af6a1df791ab412e35 (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_con/ecore_con_legacy.c4
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/ecore_con/ecore_con_legacy.c b/src/lib/ecore_con/ecore_con_legacy.c
index e99b4a90bd..684c25da58 100644
--- a/src/lib/ecore_con/ecore_con_legacy.c
+++ b/src/lib/ecore_con/ecore_con_legacy.c
@@ -2262,6 +2262,10 @@ ecore_con_server_flush(Ecore_Con_Server *svr)
2262 2262
2263 if (!svr->dialer) return; 2263 if (!svr->dialer) return;
2264 2264
2265 while (!efl_io_closer_closed_get(svr->dialer) &&
2266 !efl_net_dialer_connected_get(svr->dialer))
2267 ecore_main_loop_iterate();
2268
2265 efl_io_buffered_stream_flush(svr->dialer, EINA_FALSE, EINA_TRUE); 2269 efl_io_buffered_stream_flush(svr->dialer, EINA_FALSE, EINA_TRUE);
2266 2270
2267 inner_dialer = efl_io_buffered_stream_inner_io_get(svr->dialer); 2271 inner_dialer = efl_io_buffered_stream_inner_io_get(svr->dialer);
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)
1182 } 1182 }
1183 if (svr->dialer.input) 1183 if (svr->dialer.input)
1184 { 1184 {
1185 while (!efl_io_closer_closed_get(svr->dialer.dialer) &&
1186 !efl_net_dialer_connected_get(svr->dialer.dialer))
1187 ecore_main_loop_iterate();
1185 while (efl_io_queue_usage_get(svr->dialer.input) > 0) 1188 while (efl_io_queue_usage_get(svr->dialer.input) > 0)
1186 efl_io_copier_flush(svr->dialer.send_copier, EINA_TRUE, EINA_TRUE); 1189 efl_io_copier_flush(svr->dialer.send_copier, EINA_TRUE, EINA_TRUE);
1187 return; 1190 return;