ecore-con/legacy: kill server with DEL event if a dialer error occurs

Summary:
in the course of the efl-net rewrite, the previous relied-upon behavior
sequence of error -> disconnect -> del was broken, and error events no
longer triggered disconnects or server deletion.

the failure was caused by a check for the 'connecting' flag, preventing
DEL events from being triggered

further, the ordering of the events was flipped from ERROR -> DEL to
DEL -> ERROR; this is also fixed now

this caused any failed connection to leak the entire server connection
since existing handlers for the del event were never triggered and the
server was never destroyed

@fix
fix T6330

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6330

Differential Revision: https://phab.enlightenment.org/D6481
This commit is contained in:
Mike Blumenkrantz 2018-07-03 12:42:00 -04:00 committed by Chris Michael
parent 48eb024222
commit 683cddf90c
1 changed files with 2 additions and 1 deletions

View File

@ -983,6 +983,7 @@ _ecore_con_server_new(Eina_Bool is_dialer, Ecore_Con_Type type, const char *name
static void
_ecore_con_server_dialer_close(Ecore_Con_Server *svr)
{
svr->connecting = EINA_FALSE;
if (!svr->dialer) return;
if (!efl_io_closer_closed_get(svr->dialer))
@ -1345,8 +1346,8 @@ _ecore_con_server_dialer_error(void *data, const Efl_Event *event)
WRN("error reaching server %s: %s", efl_net_dialer_address_dial_get(svr->dialer), eina_error_msg_get(*perr));
_ecore_con_server_dialer_close(svr);
_ecore_con_post_event_server_error(svr, eina_error_msg_get(*perr));
_ecore_con_server_dialer_close(svr);
}
static void