Unify DCB close processing to single function dcb_close. Remove dcb_add_to_zombieslist (incorporating logic into dcb_close). Alter logic so that DCB that is just allocated will still go to zombie list if dcb->fd is not closed.

This commit is contained in:
counterpoint
2015-07-06 16:48:53 +01:00
parent 44fcb9bc31
commit fffd8fb73a
6 changed files with 88 additions and 120 deletions

View File

@ -315,13 +315,13 @@ int n_connect = 0;
if (telnetd_pr == NULL)
{
dcb_add_to_zombieslist(client_dcb);
dcb_close(client_dcb);
return n_connect;
}
if (poll_add_dcb(client_dcb) == -1)
if (poll_add_dcb(client_dcb))
{
dcb_add_to_zombieslist(dcb);
dcb_close(dcb);
return n_connect;
}
n_connect++;