[IOT-2380] Update ocserver sample to working with versioning.
authorbg.chun <bg.chun@samsung.com>
Wed, 31 May 2017 06:10:46 +0000 (15:10 +0900)
committerZiran Sun <ziran.sun@samsung.com>
Fri, 2 Jun 2017 10:07:28 +0000 (10:07 +0000)
Update ocserver sample to work with versioning.

Change-Id: Idae7063273a41b7a522719d830d464e7e0490eb9
Signed-off-by: bg.chun <bg.chun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20493
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp

index 95a9bdf..1888173 100644 (file)
@@ -664,6 +664,8 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
                 // Check if the option header has already existed before adding it in.
                 uint8_t optionData[MAX_HEADER_OPTION_DATA_LENGTH];
                 size_t optionDataSize = sizeof(optionData);
+
+                actualDataSize = 0;
                 OCGetHeaderOption(response.sendVendorSpecificHeaderOptions,
                                   response.numSendVendorSpecificHeaderOptions,
                                   2248,
@@ -682,6 +684,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
                                       optionDataSize2);
                 }
 
+                actualDataSize = 0;
                 OCGetHeaderOption(response.sendVendorSpecificHeaderOptions,
                                   response.numSendVendorSpecificHeaderOptions,
                                   2600,