From c4a71f2286eda412ebc17810d764d825cecef1d4 Mon Sep 17 00:00:00 2001 From: "kush.agrawal" Date: Wed, 17 Apr 2019 19:12:37 +0900 Subject: [PATCH] BlockWiseTransfer Error Issue : If packet is already received , then it was giving error. Fix : Skip processing packet if it was received once. So after receving packet which was already received earlier, it will still wait for next packet. https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/9974e6582da652f59b474e37027a46737efbac71 (cherry picked from 9974e6582da652f59b474e37027a46737efbac71) Change-Id: I20889dc55a58665bc5507d1e2e2e39bb72f65b91 Signed-off-by: kush.agrawal Signed-off-by: DoHyun Pyun --- resource/csdk/connectivity/src/cablockwisetransfer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resource/csdk/connectivity/src/cablockwisetransfer.c b/resource/csdk/connectivity/src/cablockwisetransfer.c index 10efa2e..0326f19 100755 --- a/resource/csdk/connectivity/src/cablockwisetransfer.c +++ b/resource/csdk/connectivity/src/cablockwisetransfer.c @@ -1120,10 +1120,14 @@ CAResult_t CASetNextBlockOption2(coap_pdu_t *pdu, const CAEndpoint_t *endpoint, OIC_LOG(DEBUG, TAG, "M bit is 0"); blockWiseStatus = CA_OPTION2_LAST_BLOCK; } + else if(CA_BLOCK_RECEIVED_ALREADY == blockWiseStatus)// If already received no need to update block option items. + { + OIC_LOG(DEBUG, TAG, "Already Received : M bit is 1"); + blockWiseStatus = CA_OPTION2_RESPONSE; + } else { - if (CA_BLOCK_UNKNOWN == blockWiseStatus || - CA_BLOCK_RECEIVED_ALREADY == blockWiseStatus) + if (CA_BLOCK_UNKNOWN == blockWiseStatus) { OIC_LOG(DEBUG, TAG, "M bit is 1"); blockWiseStatus = CA_OPTION2_RESPONSE; -- 2.7.4