X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fresource-encapsulation%2Fsrc%2FresourceCache%2Fsrc%2FDataCache.cpp;h=23ffd309e728f5fd8b0a6504383cd1a94ca6dff2;hb=refs%2Ftags%2Faccepted%2Ftizen%2Funified%2F20171010.063815;hp=e774d68d02ba7c72ded64478af984c84dafe883e;hpb=9b75b21e041df26d6026e00f37a270f48d1d8e65;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/resource-encapsulation/src/resourceCache/src/DataCache.cpp b/service/resource-encapsulation/src/resourceCache/src/DataCache.cpp index e774d68..23ffd30 100644 --- a/service/resource-encapsulation/src/resourceCache/src/DataCache.cpp +++ b/service/resource-encapsulation/src/resourceCache/src/DataCache.cpp @@ -208,14 +208,7 @@ namespace OIC const ResponseStatement &_rep, int _result, unsigned int _seq) { - if (_result != OC_STACK_OK || _rep.getAttributes().empty() || lastSequenceNum > _seq) - { - return; - } - else - { - lastSequenceNum = _seq; - } + lastSequenceNum = _seq; if (state != CACHE_STATE::READY) { @@ -231,7 +224,7 @@ namespace OIC networkTimer.cancel(networkTimeOutHandle); networkTimeOutHandle = networkTimer.post(CACHE_DEFAULT_EXPIRED_MILLITIME, pTimerCB); - notifyObservers(_rep.getAttributes()); + notifyObservers(_rep.getAttributes(), _result); } void DataCache::onGet(const HeaderOptions & /*_hos*/, @@ -257,10 +250,10 @@ namespace OIC pollingHandle = pollingTimer.post(CACHE_DEFAULT_REPORT_MILLITIME, pPollingCB); } - notifyObservers(_rep.getAttributes()); + notifyObservers(_rep.getAttributes(), _result); } - void DataCache::notifyObservers(const RCSResourceAttributes Att) + void DataCache::notifyObservers(const RCSResourceAttributes Att, int eCode) { { std::lock_guard lock(att_mutex); @@ -276,7 +269,7 @@ namespace OIC { if (i.second.first.rf == REPORT_FREQUENCY::UPTODATE) { - i.second.second(this->sResource, Att); + i.second.second(this->sResource, Att, eCode); } } }