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: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10091
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
{
if(strstr(ehRequest->query, OC_RSRVD_INTERFACE_BATCH))
{// When Provisioning resource has a GET with BatchInterface
{
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;
+ 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;
+
+ nextPayload = constructResponseOfDevConf();
+ if(nextPayload != NULL)
+ payload->next = nextPayload;
+ payload = payload->next;
default:
return "UNKNOWN";
}
default:
return "UNKNOWN";
}
-}
\ No newline at end of file