[IOT-2214] [RI Sample] Issue fix SimpleClientHQ pre exiting
authorarya.k <arya.kumar@samsung.com>
Fri, 5 May 2017 10:56:48 +0000 (16:26 +0530)
committerAshok Babu Channa <ashok.channa@samsung.com>
Thu, 11 May 2017 05:13:07 +0000 (05:13 +0000)
on first POST response received.

Change-Id: I15bd7b53526c9a8efb6894267948d9275ad89dd7
Signed-off-by: arya.k <arya.kumar@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19661
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/examples/simpleclientHQ.cpp

index 6219b2c..78a7794 100644 (file)
@@ -122,7 +122,8 @@ void onObserve(const HeaderOptions /*headerOptions*/, const OCRepresentation& re
 
 void onPost2(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode)
 {
-    if(eCode == SUCCESS_RESPONSE || eCode == OC_STACK_RESOURCE_CHANGED)
+    if(eCode == SUCCESS_RESPONSE || eCode == OC_STACK_RESOURCE_CHANGED
+        || eCode == OC_STACK_RESOURCE_CREATED)
     {
         std::cout << "POST request was successful" << std::endl;
 
@@ -161,7 +162,8 @@ void onPost2(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep
 void onPost(const HeaderOptions& /*headerOptions*/,
         const OCRepresentation& rep, const int eCode)
 {
-    if(eCode == SUCCESS_RESPONSE || eCode == OC_STACK_RESOURCE_CHANGED)
+    if(eCode == SUCCESS_RESPONSE || eCode == OC_STACK_RESOURCE_CHANGED
+        || eCode == OC_STACK_RESOURCE_CREATED)
     {
         std::cout << "POST request was successful" << std::endl;