From 947d995a5c6b27c09c4e66e4a6af83226e9fc1fb Mon Sep 17 00:00:00 2001 From: "hyuna0213.jo" Date: Mon, 28 Mar 2016 17:25:07 +0900 Subject: [PATCH] fixed code to get token about the empty message fixed code to get token about the empty message. Change-Id: Ifbe334f42457c1b2ba801d92cdca540433689938 Signed-off-by: hyuna0213.jo Reviewed-on: https://gerrit.iotivity.org/gerrit/7387 Tested-by: jenkins-iotivity Reviewed-by: Jaewook Jung Reviewed-by: Ashok Babu Channa --- resource/csdk/connectivity/src/cablockwisetransfer.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/resource/csdk/connectivity/src/cablockwisetransfer.c b/resource/csdk/connectivity/src/cablockwisetransfer.c index e59ba36..ad4cee3 100644 --- a/resource/csdk/connectivity/src/cablockwisetransfer.c +++ b/resource/csdk/connectivity/src/cablockwisetransfer.c @@ -1441,7 +1441,6 @@ CAResult_t CAAddBlockOption(coap_pdu_t **pdu, const CAInfo_t *info, else { OIC_LOG(INFO, TAG, "not Blockwise Transfer"); - goto exit; } } @@ -1450,11 +1449,15 @@ CAResult_t CAAddBlockOption(coap_pdu_t **pdu, const CAInfo_t *info, { // if received message type is RESET from remote device, // we have to use the updated message id of request message to find token. - res = CAUpdateMessageId(*pdu, blockDataID); - if (CA_STATUS_OK != res) + CABlockData_t *blockData = CAGetBlockDataFromBlockDataList(blockDataID); + if (blockData) { - OIC_LOG(ERROR, TAG, "fail to update message id"); - goto exit; + res = CAUpdateMessageId(*pdu, blockDataID); + if (CA_STATUS_OK != res) + { + OIC_LOG(ERROR, TAG, "fail to update message id"); + goto exit; + } } } -- 2.7.4