[IOT-2515] File descriptor leak 99/21899/8
authorVeeraj Khokale <veeraj.sk@samsung.com>
Mon, 14 Aug 2017 10:11:08 +0000 (15:41 +0530)
committerAshok Babu Channa <ashok.channa@samsung.com>
Fri, 8 Sep 2017 11:46:55 +0000 (11:46 +0000)
commit46d576b284dce592e3e513cb6dcb9c5b4f480347
tree1f95f554ae1c32ab37c327aa839467dc1c59f501
parent875916d032df89467916b09a78ef018b28b73142
[IOT-2515] File descriptor leak

Repeatedly calling OCInit2() followed by OCStop() causes
the process to run out of file descriptors. To fix this
the following changes are made to IP adapter:

1. Close the ip global socket FDs before reinitializing them.
2. Close the shutdownFds[0] FD when receive thread is stopped.

Change-Id: I1e0f336cd3d6de2297aa3421b47c8b8d810f82fb
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21899
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Todd Malsbary <todd.malsbary@intel.com>
Reviewed-by: koushik girijala <g.koushik@samsung.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/connectivity/src/ip_adapter/caipadapter.c
resource/csdk/connectivity/src/ip_adapter/caipserver.c