X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fstack%2Fsamples%2Flinux%2FSimpleClientServer%2Focclientbasicops.cpp;h=13bc01ce4732014df2fc1e772e6bbef4db3c5f1b;hb=c315c87e07c4080ecd0ef488e7a1047bc3c509b2;hp=a37f64acb1c25134baf41b6985a9b9d0bf923c51;hpb=edcfc3d2329da7b914771c0dcff5f42c9b74fd93;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp index a37f64a..13bc01c 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp @@ -119,9 +119,12 @@ OCStackResult InvokeOCDoResource(std::ostringstream &query, cbData.context = (void*)DEFAULT_CONTEXT_VALUE; cbData.cd = NULL; - ret = OCDoResource(NULL, method, query.str().c_str(), dest, - (method == OC_REST_PUT || method == OC_REST_POST) ? putPayload() : NULL, - CT_DEFAULT, qos, &cbData, options, numOptions); + OCPayload* payload = (method == OC_REST_PUT || method == OC_REST_POST) ? putPayload() : NULL; + + ret = OCDoRequest(NULL, method, query.str().c_str(), dest, + payload, CT_DEFAULT, qos, &cbData, options, numOptions); + + OCPayloadDestroy(payload); if (ret != OC_STACK_OK) { @@ -367,8 +370,8 @@ int InitDiscovery() cbData.context = (void*)DEFAULT_CONTEXT_VALUE; cbData.cd = NULL; - ret = OCDoResource(NULL, OC_REST_DISCOVER, queryUri, 0, 0, CT_DEFAULT, - OC_LOW_QOS, &cbData, NULL, 0); + ret = OCDoRequest(NULL, OC_REST_DISCOVER, queryUri, 0, 0, CT_DEFAULT, + OC_LOW_QOS, &cbData, NULL, 0); if (ret != OC_STACK_OK) { OIC_LOG(ERROR, TAG, "OCStack resource error");