[IOT-2874] Do not drop CON duplicated requests 95/23095/4
authorVeeraj Khokale <veeraj.sk@samsung.com>
Tue, 7 Nov 2017 05:20:44 +0000 (10:50 +0530)
committerVeeraj Khokale <veeraj.sk@samsung.com>
Tue, 7 Nov 2017 06:37:36 +0000 (06:37 +0000)
According to COAP spec section 4.5, confirmable duplicated
requests should not be silently dropped, instead they need
to be acknowledged every time. Therefore check if message
is confirmable before dropping it.

Change-Id: Ie7a49da9f7869fc11f679054fe8dd5c78684eb53
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
resource/csdk/connectivity/src/camessagehandler.c

index a3eab7d..aae3458 100644 (file)
@@ -202,7 +202,8 @@ static CAData_t* CAGenerateHandlerData(const CAEndpoint_t *endpoint,
             goto exit;
         }
 
-        if (CADropSecondMessage(&caglobals.ca.requestHistory, endpoint, reqInfo->info.messageId,
+        if ((reqInfo->info.type != CA_MSG_CONFIRM) &&
+            CADropSecondMessage(&caglobals.ca.requestHistory, endpoint, reqInfo->info.messageId,
                                 reqInfo->info.token, reqInfo->info.tokenLength))
         {
             OIC_LOG(INFO, TAG, "Second Request with same Token, Drop it");