return NULL;
}
+ // check the method type of request info.
+ // Keep this check in sync with CAMethod_t
+ switch (rep->method)
+ {
+ case CA_GET:
+ case CA_POST:
+ case CA_PUT:
+ case CA_DELETE:
+ break;
+ default:
+ OIC_LOG_V(ERROR, TAG, "Method %u is invalid", rep->method);
+ return NULL;
+ }
+
// allocate the request info structure.
CARequestInfo_t *clone = (CARequestInfo_t *) OICMalloc(sizeof(CARequestInfo_t));
if (!clone)
clone->numOptions = info->numOptions;
}
+ memcpy(&(clone->identity), &(info->identity), sizeof(info->identity));
+
if ((info->payload) && (0 < info->payloadSize))
{
// allocate payload field