remove unnecessary code in messagehandler
authorhyuna0213.jo <hyuna0213.jo@samsung.com>
Tue, 23 Jun 2015 10:55:55 +0000 (19:55 +0900)
committerErich Keane <erich.keane@intel.com>
Tue, 23 Jun 2015 16:17:23 +0000 (16:17 +0000)
- remove the duplicated log message for the debugging
- add the null check logic for token

Change-Id: Icfd74fcc350b6e1c9038acdac290cfcaf9d344e7
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1402
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/connectivity/src/camessagehandler.c

index 042fcee..f221843 100644 (file)
@@ -381,10 +381,6 @@ static void CAReceivedPacketCallback(const CAEndpoint_t *endpoint, void *data, u
             OIC_LOG_BUFFER(DEBUG, TAG, (const uint8_t *) ReqInfo->info.token,
                            ReqInfo->info.tokenLength);
         }
-
-        OIC_LOG_V(DEBUG, TAG, "Request- code: %d", ReqInfo->method);
-        OIC_LOG(DEBUG, TAG, "Request- token");
-        OIC_LOG_BUFFER(DEBUG, TAG, (const uint8_t *) ReqInfo->info.token, CA_MAX_TOKEN_LEN);
         OIC_LOG_V(DEBUG, TAG, "Request- msgID : %d", ReqInfo->info.messageId);
         // store the data at queue.
         CAData_t *cadata = NULL;
@@ -438,7 +434,12 @@ static void CAReceivedPacketCallback(const CAEndpoint_t *endpoint, void *data, u
             OIC_LOG_V(DEBUG, TAG, "Response- payload: %s", ResInfo->info.payload);
         }
         OIC_LOG_V(DEBUG, TAG, "Response- code: %d", ResInfo->result);
-        OIC_LOG_V(DEBUG, TAG, "Response- token : %s", ResInfo->info.token);
+        if (NULL != ResInfo->info.token)
+        {
+            OIC_LOG(DEBUG, TAG, "Response- token:");
+            OIC_LOG_BUFFER(DEBUG, TAG, (const uint8_t *) ResInfo->info.token,
+                           ResInfo->info.tokenLength);
+        }
         OIC_LOG_V(DEBUG, TAG, "Response- msgID: %d", ResInfo->info.messageId);
 
         // store the data at queue.