When provider information was stored,
storage module copy whole of provider connections,
but first pointer of connection information was wrongly redefine with next connection information.
For the reason, first connection information was ignored.
In this patch wrongly calculation of pointer was fixed.
Change-Id: Ic91abd458979c2b113e641b3d9c28e6894dd5b7f
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10723
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
NSProviderConnectionInfo * retInfo = NSCreateProviderConnections(tmp->addr);
NS_VERIFY_NOT_NULL(retInfo, NULL);
NSProviderConnectionInfo * retInfo = NSCreateProviderConnections(tmp->addr);
NS_VERIFY_NOT_NULL(retInfo, NULL);
+ retInfo->messageHandle = tmp->messageHandle;
+ retInfo->syncHandle = tmp->syncHandle;
+ retInfo->isCloudConnection = tmp->isCloudConnection;
+ retInfo->isSubscribing = tmp->isSubscribing;
+
tmp = tmp->next;
NSProviderConnectionInfo * copyInfo = retInfo;
while(tmp)
{
tmp = tmp->next;
NSProviderConnectionInfo * copyInfo = retInfo;
while(tmp)
{
- copyInfo = NSCreateProviderConnections(tmp->addr);
- NS_VERIFY_NOT_NULL(copyInfo, NULL);
+ NSProviderConnectionInfo * tmpInfo = NSCreateProviderConnections(tmp->addr);
+ NS_VERIFY_NOT_NULL(tmpInfo, NULL);
- copyInfo->messageHandle = tmp->messageHandle;
- copyInfo->syncHandle = tmp->syncHandle;
- copyInfo->isCloudConnection = tmp->isCloudConnection;
- copyInfo->isSubscribing = tmp->isSubscribing;
+ tmpInfo->messageHandle = tmp->messageHandle;
+ tmpInfo->syncHandle = tmp->syncHandle;
+ tmpInfo->isCloudConnection = tmp->isCloudConnection;
+ tmpInfo->isSubscribing = tmp->isSubscribing;
- copyInfo = copyInfo->next;
+ copyInfo->next = tmpInfo;
+ copyInfo = tmpInfo;
case OC_STACK_OK:
case OC_STACK_RESOURCE_CREATED:
case OC_STACK_RESOURCE_DELETED:
case OC_STACK_OK:
case OC_STACK_RESOURCE_CREATED:
case OC_STACK_RESOURCE_DELETED:
+ case OC_STACK_PRESENCE_STOPPED:
case OC_STACK_CONTINUE:
case OC_STACK_RESOURCE_CHANGED:
return true;
case OC_STACK_CONTINUE:
case OC_STACK_RESOURCE_CHANGED:
return true;