requestResult = HandleStackRequests (&serverRequest);
// Send ACK to client as precursor to slow response
- if(requestResult == OC_STACK_SLOW_RESOURCE)
+ if (requestResult == OC_STACK_SLOW_RESOURCE)
{
- SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_EMPTY,
- CA_MSG_ACKNOWLEDGE,0, NULL, NULL, 0, NULL);
+ if (requestInfo->info.type == CA_MSG_CONFIRM)
+ {
+ SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_EMPTY,
+ CA_MSG_ACKNOWLEDGE,0, NULL, NULL, 0, NULL);
+ }
}
else if(requestResult != OC_STACK_OK)
{
char *resourceUri = NULL;
char *resourceType = NULL;
- // This validation is broken, but doesn't cause harm
- size_t uriLen = strlen(requestUri );
- if ((result = verifyUriQueryLength(requestUri , uriLen)) != OC_STACK_OK)
- {
- goto exit;
- }
-
/*
* Support original behavior with address on resourceUri argument.
*/
OCDirectPairingCB resultCallback)
{
OIC_LOG(INFO, TAG, "Start OCDoDirectPairing");
- if(NULL == peer)
+ if(NULL == peer || NULL == pinNumber)
{
OIC_LOG(ERROR, TAG, "Invalid parameters");
return OC_STACK_INVALID_PARAM;
}
-
- if(NULL == resultCallback)
+ if (NULL == resultCallback)
{
- OIC_LOG(ERROR, TAG, "Invalid parameters");
+ OIC_LOG(ERROR, TAG, "Invalid callback");
return OC_STACK_INVALID_CALLBACK;
}
+
gDirectpairingCallback = resultCallback;
return DPDirectPairing((OCDirectPairingDev_t*)peer, (OicSecPrm_t)pmSel,
pinNumber, DirectPairingCB);