return OC_STACK_KEEP_TRANSACTION;
}
- try{
+ try
+ {
ListenOCContainer container(clientWrapper, clientResponse->devAddr,
reinterpret_cast<OCDiscoveryPayload*>(clientResponse->payload));
// loop to ensure valid construction of all resources
exec.detach();
}
}
- catch (std::exception &e){
+ catch (std::exception &e)
+ {
oclog() << "Exception in listCallback, ignoring response: "
<< e.what() << std::flush;
}
std::string resourceURI = clientResponse->resourceUri;
std::thread exec(context->errorCallback, resourceURI, result);
exec.detach();
- return OC_STACK_DELETE_TRANSACTION;
+ return OC_STACK_KEEP_TRANSACTION;
}
OCStackResult InProcClientWrapper::ListenForResource(
return OC_STACK_DELETE_TRANSACTION;
}
+ std::string resourceURI = clientResponse->resourceUri;
if (clientResponse->result != OC_STACK_OK)
{
oclog() << "listenMQCallback(): failed to create resource. clientResponse: "
<< std::flush;
std::thread exec(context->callback, clientResponse->result,
- clientResponse->resourceUri, nullptr);
+ resourceURI, nullptr);
exec.detach();
return OC_STACK_DELETE_TRANSACTION;
return OC_STACK_DELETE_TRANSACTION;
}
- try{
+ try
+ {
ListenOCContainer container(clientWrapper, clientResponse->devAddr,
(OCRepPayload *) clientResponse->payload);
for (auto resource : container.Resources())
{
std::thread exec(context->callback, clientResponse->result,
- clientResponse->resourceUri, resource);
+ resourceURI, resource);
exec.detach();
}
}
- catch (std::exception &e){
+ catch (std::exception &e)
+ {
oclog() << "Exception in listCallback, ignoring response: "
<< e.what() << std::flush;
}
if (!isLocationOption)
{
- createdUri = clientResponse->resourceUri;
+ createdUri = std::string(clientResponse->resourceUri);
}
auto clientWrapper = context->clientWrapper.lock();
return OC_STACK_DELETE_TRANSACTION;
}
- try{
+ try
+ {
if (OC_STACK_OK == result ||
OC_STACK_RESOURCE_CREATED == result)
{
createdUri);
for (auto resource : container.Resources())
{
- std::thread exec(context->callback, result, createdUri, resource);
+ std::thread exec(context->callback, result,
+ createdUri,
+ resource);
exec.detach();
}
}
else
{
- std::thread exec(context->callback, result, createdUri, nullptr);
+ std::thread exec(context->callback, result,
+ createdUri,
+ nullptr);
exec.detach();
}
}
- catch (std::exception &e){
+ catch (std::exception &e)
+ {
oclog() << "Exception in createMQTopicCallback, ignoring response: "
<< e.what() << std::flush;
}
std::thread exec(context->callback, serverHeaderOptions, attrs,
result, sequenceNumber);
exec.detach();
+ if (sequenceNumber == MAX_SEQUENCE_NUMBER + 1)
+ {
+ return OC_STACK_DELETE_TRANSACTION;
+ }
return OC_STACK_KEEP_TRANSACTION;
}
std::lock_guard<std::recursive_mutex> lock(*cLock);
std::ostringstream os;
- os << host << OCF_RSRVD_DEVICE_PRESENCE_URI;
+ os << host << OC_RSRVD_DEVICE_PRESENCE_URI;
QueryParamsList queryParams({{OC_RSRVD_DEVICE_ID, di}});
std::string url = assembleSetResourceUri(os.str(), queryParams);