diff options
author | Cedric BAIL <cedric@osg.samsung.com> | 2018-11-30 15:26:12 -0800 |
---|---|---|
committer | Christopher Michael <cp.michael@samsung.com> | 2018-12-06 12:06:17 -0500 |
commit | d5d6aa701b159225eeeb01594853c05aba1273ea (patch) | |
tree | f9a84d701354116bd32a47784b9442a67c8a082a | |
parent | 09ca4531bb8fe5ba47eac0659bd60d78cbb2d2ee (diff) |
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
-rw-r--r-- | src/lib/ecore_con/efl_net_dialer_tcp.c | 2 |
1 files changed, 2 insertions, 0 deletions
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 | |||
241 | _efl_net_dialer_tcp_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Tcp_Data *pd, Eina_Bool connected) | 241 | _efl_net_dialer_tcp_efl_net_dialer_connected_set(Eo *o, Efl_Net_Dialer_Tcp_Data *pd, Eina_Bool connected) |
242 | { | 242 | { |
243 | if (pd->connect.timeout) eina_future_cancel(pd->connect.timeout); | 243 | if (pd->connect.timeout) eina_future_cancel(pd->connect.timeout); |
244 | // This has to be done before the state check as there could be a connection in progress that need to be canceled | ||
245 | if (!connected) _efl_net_dialer_tcp_async_stop(pd); | ||
244 | if (pd->connected == connected) return; | 246 | if (pd->connected == connected) return; |
245 | pd->connected = connected; | 247 | pd->connected = connected; |
246 | if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, NULL); | 248 | if (connected) efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, NULL); |