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
This commit is contained in:
Cedric BAIL 2018-11-30 15:26:12 -08:00 committed by Marcel Hollerbach
parent 4485cf64a0
commit b6346d0bb3
1 changed files with 2 additions and 0 deletions

View File

@ -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);