replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / service / resource-encapsulation / src / resourceCache / src / DataCache.cpp
index e774d68..23ffd30 100644 (file)
@@ -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<std::mutex> 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);
                 }
             }
         }