[IOT-2302] Don't assert roles for KeepAlive 17/20217/6
authorhyuna0213.jo <hyuna0213.jo@samsung.com>
Mon, 22 May 2017 11:29:46 +0000 (20:29 +0900)
committerUze Choi <uzchoi@samsung.com>
Mon, 22 May 2017 16:02:13 +0000 (16:02 +0000)
Remove assert role in case of TCP KeepAlive

Patch #1: initial upload

Bug: https://jira.iotivity.org/browse/IOT-2302
Change-Id: If99610a3a302357aa33ac0d1466219e78fdd01fa
Signed-off-by: Jongmin Choi <jminl.choi@samsung.com>
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20217
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
resource/csdk/stack/src/ocstack.c

index 4d04010..fcc2c04 100644 (file)
@@ -1646,7 +1646,7 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
                 requestData.resourceUri = OICStrdup(cbNode->requestUri);
 
                 requestInfo.info = requestData;
+
                 // send request
                 OCStackResult result = OCSendRequest(endPoint, &requestInfo);
                 if (OC_STACK_OK == result)
@@ -3614,7 +3614,9 @@ OCStackResult OCDoRequest(OCDoHandle *handle,
     /* Check whether we should assert role certificates before making this request. */
     if ((endpoint.flags & CA_SECURE) && (NULL != requestInfo.info.resourceUri) &&
         (strcmp(requestInfo.info.resourceUri, OIC_RSRC_ROLES_URI) != 0) &&
-        (strcmp(requestInfo.info.resourceUri, OIC_RSRC_DOXM_URI) != 0))
+        (strcmp(requestInfo.info.resourceUri, OIC_RSRC_DOXM_URI) != 0) &&
+        ((CT_ADAPTER_TCP == connectivityType) &&
+                strcmp(requestInfo.info.resourceUri, OC_RSRVD_KEEPALIVE_URI) != 0))
     {
         CASecureEndpoint_t sep;
         CAResult_t caRes = CAGetSecureEndpointData(&endpoint, &sep);
@@ -6253,7 +6255,7 @@ OCStackResult OCSelectCipherSuite(uint16_t cipher, OCTransportAdapter adapterTyp
 
 #ifdef RA_ADAPTER
     OC_STATIC_ASSERT(
-        (unsigned int)OC_ADAPTER_REMOTE_ACCESS 
+        (unsigned int)OC_ADAPTER_REMOTE_ACCESS
             == (unsigned int)CA_ADAPTER_REMOTE_ACCESS, "OC/CA bit mismatch");
 
     #define ALL_OC_ADAPTER_TYPES (OC_ADAPTER_IP | OC_ADAPTER_GATT_BTLE | OC_ADAPTER_RFCOMM_BTEDR |\