Fix a faulty logic in PMSingleDeviceDiscovery
authorJihun Ha <jihun.ha@samsung.com>
Wed, 12 Oct 2016 11:06:29 +0000 (20:06 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Thu, 13 Oct 2016 04:28:23 +0000 (04:28 +0000)
A device discovery transaction should be removed AFTER port discovery
is done or discovery time is expired.

Change-Id: I55062a3a8ef5187bf249d0afee2276e40c0f52d9
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13167
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Joonghwan Lee <jh05.lee@samsung.com>
Reviewed-by: Heewon Park <h_w.park@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/provisioning/src/pmutility.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 6f1bec1..b8c053c
@@ -766,10 +766,6 @@ static OCStackApplicationResult DeviceDiscoveryHandler(void *ctx, OCDoHandle UNU
                 }
 
                 OIC_LOG(INFO, TAG, "Exiting ProvisionDiscoveryHandler.");
-                if(pDInfo->isSingleDiscovery)
-                {
-                    return OC_STACK_DELETE_TRANSACTION;
-                }
             }
 
             return  OC_STACK_KEEP_TRANSACTION;
@@ -873,11 +869,7 @@ OCStackResult PMSingleDeviceDiscovery(unsigned short waittime, const OicUuid_t*
         return res;
     }
 
-    if(NULL == *ppFoundDevice)
-    {
-        res = OCCancel(handle,OC_HIGH_QOS,NULL,0);
-    }
-
+    res = OCCancel(handle,OC_HIGH_QOS,NULL,0);
     if (OC_STACK_OK != res)
     {
         OIC_LOG(ERROR, TAG, "Failed to remove registered callback");