From b6346d0bb3ab93a86efb1f22ef2c710782859f15 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 30 Nov 2018 15:26:12 -0800 Subject: [PATCH] ecore_con: enforce connection state to not let a hanging connection continue. It is expected that when the connection state is forcefully set, that all hanging connection should be stopped instead of them continuing and later resetting the state to having a connection. Differential Revision: https://phab.enlightenment.org/D7397 --- src/lib/ecore_con/efl_net_dialer_tcp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/ecore_con/efl_net_dialer_tcp.c b/src/lib/ecore_con/efl_net_dialer_tcp.c index a35d56501d..57f5cf93cd 100644 --- a/src/lib/ecore_con/efl_net_dialer_tcp.c +++ b/src/lib/ecore_con/efl_net_dialer_tcp.c @@ -241,6 +241,8 @@ EOLIAN static void _efl_net_dialer_tcp_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Tcp_Data *pd, Eina_Bool connected) { if (pd->connect.timeout) eina_future_cancel(pd->connect.timeout); + // This has to be done before the state check as there could be a connection in progress that need to be canceled + if (!connected) _efl_net_dialer_tcp_async_stop(pd); if (pd->connected == connected) return; pd->connected = connected; if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, NULL);