From 4252b9780afb6084305d8ed197542301d559385b Mon Sep 17 00:00:00 2001 From: "jihwan.seo" Date: Thu, 17 Nov 2016 07:36:27 +0900 Subject: [PATCH] add log message for TCP adapter Change-Id: I7803348f17ac8b860863e25a35c6a12b73a5886d Signed-off-by: jihwan.seo Reviewed-on: https://gerrit.iotivity.org/gerrit/14431 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai --- resource/csdk/connectivity/src/tcp_adapter/catcpserver.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c b/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c index b8b4fa0..329a4cd 100644 --- a/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c +++ b/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c @@ -1180,6 +1180,7 @@ size_t CACheckPayloadLengthFromHeader(const void *data, size_t dlen) static ssize_t sendData(const CAEndpoint_t *endpoint, const void *data, size_t dlen, const char *fam) { + OIC_LOG_V(DEBUG, TAG, "%s", __func__); // #1. get TCP Server object from list size_t index = 0; CATCPSessionInfo_t *svritem = CAGetTCPSessionInfoFromEndpoint(endpoint, &index); @@ -1229,6 +1230,7 @@ static ssize_t sendData(const CAEndpoint_t *endpoint, const void *data, ssize_t CATCPSendData(CAEndpoint_t *endpoint, const void *data, size_t datalen) { + OIC_LOG_V(DEBUG, TAG, "%s", __func__); VERIFY_NON_NULL_RET(endpoint, TAG, "endpoint is NULL", -1); VERIFY_NON_NULL_RET(data, TAG, "data is NULL", -1); @@ -1304,6 +1306,7 @@ CAResult_t CAGetTCPInterfaceInformation(CAEndpoint_t **info, uint32_t *size) CATCPSessionInfo_t *CAConnectTCPSession(const CAEndpoint_t *endpoint) { + OIC_LOG_V(DEBUG, TAG, "%s", __func__); VERIFY_NON_NULL_RET(endpoint, TAG, "endpoint is NULL", NULL); // #1. create TCP server object @@ -1358,6 +1361,7 @@ CATCPSessionInfo_t *CAConnectTCPSession(const CAEndpoint_t *endpoint) CAResult_t CADisconnectTCPSession(CATCPSessionInfo_t *svritem, size_t index) { + OIC_LOG_V(DEBUG, TAG, "%s", __func__); VERIFY_NON_NULL(svritem, TAG, "svritem is NULL"); oc_mutex_lock(g_mutexObjectList); @@ -1366,6 +1370,8 @@ CAResult_t CADisconnectTCPSession(CATCPSessionInfo_t *svritem, size_t index) if (svritem->fd >= 0) { close(svritem->fd); + svritem->fd = -1; + OIC_LOG(DEBUG, TAG, "close socket"); } u_arraylist_remove(caglobals.tcp.svrlist, index); OICFree(svritem->data); @@ -1440,7 +1446,7 @@ CATCPSessionInfo_t *CAGetTCPSessionInfoFromEndpoint(const CAEndpoint_t *endpoint return svritem; } } - + OIC_LOG(DEBUG, TAG, "there is no session info in the svrlist"); return NULL; } -- 2.7.4