OIC_LOG(ERROR, TAG, "Failed to close TLS session");
}
#endif
- CADisconnectTCPSession(svritem, index);
- CACleanData(svritem);
+ CASearchAndDeleteTCPSession(&(svritem->sep.endpoint));
+ return;
}
}
OIC_LOG_V(DEBUG, TAG, "%s", __func__);
VERIFY_NON_NULL(svritem, TAG, "svritem is NULL");
- oc_mutex_lock(g_mutexObjectList);
-
- // close the socket and remove TCP connection info in list
+ // close the socket and remove TCP connection info in list.
if (svritem->fd >= 0)
{
shutdown(svritem->fd, SHUT_RDWR);
}
OICFree(svritem);
- oc_mutex_unlock(g_mutexObjectList);
-
return CA_STATUS_OK;
}
CAResult_t CASearchAndDeleteTCPSession(const CAEndpoint_t *endpoint)
{
+ oc_mutex_lock(g_mutexObjectList);
+
CAResult_t result = CA_STATUS_OK;
size_t index = 0;
CATCPSessionInfo_t *svritem = CAGetTCPSessionInfoFromEndpoint(endpoint, &index);
}
}
+ oc_mutex_unlock(g_mutexObjectList);
return result;
}