[CONPRO-1430] BlockWiseTransfer Error 34/208334/1
authorkush.agrawal <kush.agrawal@samsung.com>
Wed, 17 Apr 2019 10:12:37 +0000 (19:12 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 24 Jun 2019 00:47:54 +0000 (09:47 +0900)
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 <kush.agrawal@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
resource/csdk/connectivity/src/cablockwisetransfer.c

index 10efa2e..0326f19 100755 (executable)
@@ -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;