{
OIC_LOG(DEBUG, TAG, "code is CA_EMPTY..");
- // get token from block-wise transfer list when CA_EMPTY(RST/ACK) is received
- CAResult_t res = CAGetTokenFromBlockDataList(pdu, endpoint, receivedData->responseInfo);
- if (CA_STATUS_OK != res)
+ if (!receivedData->responseInfo->info.token)
{
- OIC_LOG(ERROR, TAG, "fail to get token");
- return res;
+ // get token from block-wise transfer list when CA_EMPTY(RST/ACK) is received
+ CAResult_t res = CAGetTokenFromBlockDataList(pdu, endpoint,
+ receivedData->responseInfo);
+ if (CA_STATUS_OK != res)
+ {
+ OIC_LOG(ERROR, TAG, "fail to get token");
+ return res;
+ }
}
CABlockDataID_t* blockDataID = CACreateBlockDatablockId(
OIC_LOG(INFO, TAG, "retransmission was stopped");
return CA_REQUEST_TIMEOUT;
}
- else
- {
- OIC_LOG(ERROR, TAG, "blockId is null");
- CADestroyBlockID(blockDataID);
- return CA_STATUS_FAILED;
- }
+
+ OIC_LOG(ERROR, TAG, "blockId is null");
+ CADestroyBlockID(blockDataID);
+ return CA_STATUS_FAILED;
}
CARemoveBlockDataFromList(blockDataID);
CARetransmissionReceivedData(&g_retransmissionContext, cadata->remoteEndpoint, pdu->hdr,
pdu->length, &retransmissionPdu);
-#ifndef WITH_BWT
// get token from saved data in retransmission list
if (retransmissionPdu && CA_EMPTY == code)
{
}
}
}
-#endif
OICFree(retransmissionPdu);
}
}
}
OCResourcePayload *resource = (OCResourcePayload*) payload->resources;
- if (!resource)
+ int found = 0;
+ while (resource)
{
- OIC_LOG_V (INFO, TAG, "No resources in payload");
- return OC_STACK_DELETE_TRANSACTION;
+ if(resource->uri && strcmp(resource->uri, coapServerResource.c_str()) == 0)
+ {
+ found = 1;
+ break;
+ }
+ resource = resource->next;
+ }
+
+ if(!found)
+ {
+ OIC_LOG_V (INFO, TAG, "No /a/light in payload");
+ return OC_STACK_KEEP_TRANSACTION;
}
- coapServerResource = resource->uri;
switch(TestCase)
{