Commit d2f91e30 authored by Jihun Ha's avatar Jihun Ha Committed by Madan Lanka

Fix a logic in linking child representation payload in batch interface

If provisioning resource receives a GET request with BATCH interface and
cloud resource is not created by user's decision, device configuration
resource's representation will not delivered even if device configuration
resource exists. This patch fixes this issue.

Change-Id: I90a43e58cf12dab0732857418fae7f4a7ef9dc1a
Signed-off-by: default avatarJihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10091Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarMadan Lanka <lanka.madan@samsung.com>
parent 53479c7b
......@@ -552,25 +552,31 @@ OCRepPayload* constructResponseOfProv(OCEntityHandlerRequest *ehRequest)
{
if(strstr(ehRequest->query, OC_RSRVD_INTERFACE_BATCH))
{// When Provisioning resource has a GET with BatchInterface
payload->next = constructResponseOfWiFi();
OCRepPayload* head = payload;
OCRepPayload* nextPayload = NULL;
if(payload->next)
nextPayload = constructResponseOfWiFi();
if(nextPayload != NULL)
{
payload->next->next = constructResponseOfCloud();
}
else
{
return payload;
payload->next = nextPayload;
payload = payload->next;
}
if(payload->next->next)
nextPayload = constructResponseOfCloud();
if(nextPayload != NULL)
{
payload->next->next->next = constructResponseOfDevConf();
payload->next = nextPayload;
payload = payload->next;
}
else
nextPayload = constructResponseOfDevConf();
if(nextPayload != NULL)
{
return payload;
payload->next = nextPayload;
payload = payload->next;
}
payload = head;
}
}
......@@ -978,4 +984,4 @@ const char *getResult(OCStackResult result)
default:
return "UNKNOWN";
}
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment