To Enable empty token for CoAP
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 18 Nov 2015 06:45:35 +0000 (15:45 +0900)
committerJon A. Cruz <jonc@osg.samsung.com>
Wed, 18 Nov 2015 21:15:03 +0000 (21:15 +0000)
since token can be used 0~8 byte by spec.
to check null token should be removed.

Change-Id: I0e3b6a605e647206e9f886c9f7e406b6ea6e5288
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4261
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
resource/csdk/connectivity/src/cablockwisetransfer.c

index 5df026e..dbab84e 100644 (file)
@@ -2667,8 +2667,6 @@ void CADestroyDataSet(CAData_t* data)
 CABlockDataID_t* CACreateBlockDatablockId(const CAToken_t token, uint8_t tokenLength,
                                           uint16_t portNumber)
 {
-    VERIFY_NON_NULL_RET(token, TAG, "token", NULL);
-
     char port[PORT_LENGTH] = {0,};
     port[0] = (char)((portNumber>>8) & 0xFF);
     port[1] = (char)(portNumber & 0xFF);
@@ -2688,7 +2686,11 @@ CABlockDataID_t* CACreateBlockDatablockId(const CAToken_t token, uint8_t tokenLe
         return NULL;
     }
 
-    memcpy(blockDataID->id, token, tokenLength);
+    if (token)
+    {
+        memcpy(blockDataID->id, token, tokenLength);
+    }
+
     memcpy(blockDataID->id + tokenLength, port, sizeof(port));
 
     OIC_LOG(DEBUG, TAG, "BlockID is ");