Problem regarding NON request on Slow Response server
authorhyuna0213.jo <hyuna0213.jo@samsung.com>
Mon, 28 Mar 2016 07:29:45 +0000 (16:29 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Mon, 28 Mar 2016 12:49:49 +0000 (12:49 +0000)
When a slow responding server receives a NON type request,
it is sending back an ACK message immediately, and then later,
sending NON response. According to RFC-7252, response of NON request
should only be a NON, there should not be any ACK in between.

Change-Id: I0b00c2423660d622df8490bf03011d18a1c26126
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7385
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/stack/src/ocstack.c

index 65b931d..0f0d536 100644 (file)
@@ -1788,10 +1788,10 @@ void OCHandleRequests(const CAEndpoint_t* endPoint, const CARequestInfo_t* reque
     requestResult = HandleStackRequests (&serverRequest);
 
     // Send ACK to client as precursor to slow response
-    if(requestResult == OC_STACK_SLOW_RESOURCE)
+    if (requestResult == OC_STACK_SLOW_RESOURCE && requestInfo->info.type == CA_MSG_CONFIRM)
     {
         SendDirectStackResponse(endPoint, requestInfo->info.messageId, CA_EMPTY,
-                    CA_MSG_ACKNOWLEDGE,0, NULL, NULL, 0, NULL);
+                                CA_MSG_ACKNOWLEDGE,0, NULL, NULL, 0, NULL);
     }
     else if(requestResult != OC_STACK_OK)
     {