- add socket fd initialization after closing TCP session in tcpserver
Change-Id: Icb40f0c37ccc17ee9972974cfeae752e3a60048d
Signed-off-by: Hyuna Jo <hyuna0213.jo@samsung.com>
Signed-off-by: Minji Park <minjii.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14499
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
if (FD_ISSET(svritem->fd, readFds))
{
CAReceiveMessage(svritem->fd);
- FD_CLR(svritem->fd, readFds);
+ if (-1 != svritem->fd)
+ {
+ FD_CLR(svritem->fd, readFds);
+ }
}
}
}
{
shutdown(svritem->fd, SHUT_RDWR);
close(svritem->fd);
+ svritem->fd = -1;
}
u_arraylist_remove(caglobals.tcp.svrlist, index);
OICFree(svritem->data);
}
OICFree(svritem);
+ svritem = NULL;
return CA_STATUS_OK;
}