g_free(arg);
+ pResponse->setRequestHandle(request->getRequestHandle());
+ pResponse->setResourceHandle(request->getResourceHandle());
pResponse->setErrorCode(200);
pResponse->setResponseResult(OC_EH_OK);
OCPlatform::sendResponse(pResponse);
}
static void _on_post(const HeaderOptions& /*headerOptions*/,
- const OCRepresentation& rep, const int eCode)
+ const OCRepresentation& rep, const int eCode,
+ void *user_data)
{
last_get_result = eCode;
int ret;
LOG_ERR("Exception %s in on post", e.what());
}
+ _clear_user_data(user_data);
}
static bool _found_resource(std::shared_ptr<OCResource> resource,
rep.setValue("data", std::string(cmd->arg1));
#endif
}
- resource->post(rep, QueryParamsMap(), &_on_post);
+ resource->post(rep, QueryParamsMap(),
+ std::bind (&_on_post, std::placeholders::_1,
+ std::placeholders::_2, std::placeholders::_3, cmd));
}
}