X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fstack%2Fsamples%2Flinux%2Fsecure%2Focserverbasicops.cpp;h=9e161ef75280cefd0018c8528ca108c3332b969e;hb=8229635f6d207516ccbbdf23b13be164e0fc1787;hp=22bc6743a836214f3c30b88c14fec47c65279bb7;hpb=ef332833dd3989e8e4aa4da5572423e0b2ffd89b;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp b/resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp index 22bc674..9e161ef 100644 --- a/resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp +++ b/resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp @@ -18,12 +18,20 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#include "iotivity_config.h" #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_WINDOWS_H +#include +#endif #include +#ifdef HAVE_PTHREAD_H #include +#endif #include "ocstack.h" #include "logger.h" #include "ocpayload.h" @@ -87,7 +95,8 @@ OCRepPayload* constructResponse (OCEntityHandlerRequest *ehRequest) gResourceUri = (char *) "/a/led/1"; } - if(OC_REST_PUT == ehRequest->method) + if(OC_REST_PUT == ehRequest->method + || OC_REST_POST == ehRequest->method) { // Get pointer to query int64_t pow; @@ -160,7 +169,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest, * resource is created with default representation (if representation is included in * POST payload it can be used as initial values) as long as the instance is * lesser than max new instance count. Once max instance count is reached, POST on - * /a/led updated the representation of /a/led (just like PUT) + * /a/led updated the representation of /a/led. */ if (ehRequest->resource == LED.handle) @@ -292,7 +301,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag, } } - OCPayloadDestroy(response.payload); + OCRepPayloadDestroy(payload); return ehResult; }