From 0174fdf78bd155f5c4e82ec53df285bc9de099e7 Mon Sep 17 00:00:00 2001 From: "js126.lee" Date: Wed, 18 May 2016 15:28:18 +0900 Subject: [PATCH] [IOT-1097] Fixed bug related to dpc property in doxm Issue : There is bug when handling dpc property Solution : If PUT/POST payload do not has dpc in doxm, iotivity server keep own dpc value. Related jira : https://jira.iotivity.org/browse/IOT-1097 Change-Id: I6a1d5874240d81b2ef590831d1db4a3b69c89fa4 Signed-off-by: js126.lee Reviewed-on: https://gerrit.iotivity.org/gerrit/8313 Tested-by: jenkins-iotivity Reviewed-by: Chul Lee Reviewed-by: Randeep Singh --- resource/csdk/security/src/doxmresource.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resource/csdk/security/src/doxmresource.c b/resource/csdk/security/src/doxmresource.c index d48c8ef..19c1244 100644 --- a/resource/csdk/security/src/doxmresource.c +++ b/resource/csdk/security/src/doxmresource.c @@ -231,7 +231,7 @@ OCStackResult DoxmToCBORPayload(const OicSecDoxm_t *doxm, uint8_t **payload, siz OICFree(strUuid); strUuid = NULL; - //DPC -- Mandatory + //DPC -- not Mandatory, but this type is boolean, so instance always has a value. cborEncoderResult = cbor_encode_text_string(&doxmMap, OIC_JSON_DPC_NAME, strlen(OIC_JSON_DPC_NAME)); VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding DPC Tag."); @@ -390,10 +390,10 @@ OCStackResult CBORPayloadToDoxm(const uint8_t *cborPayload, size_t size, cborFindResult = cbor_value_get_boolean(&doxmMap, &doxm->dpc); VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding DPC Value.") } - else // PUT/POST JSON may not have owned so set it to the gDomx->owned + else // PUT/POST JSON may not have dpc so set it to the gDomx->dpc { VERIFY_NON_NULL(TAG, gDoxm, ERROR); - doxm->owned = false; + doxm->dpc = gDoxm->dpc; } cborFindResult = cbor_value_map_find_value(&doxmCbor, OIC_JSON_DEVICE_ID_NAME, &doxmMap); -- 2.7.4