svcresource.c return handler 63/15363/7
authorHabib Virji <habib.virji@samsung.com>
Fri, 9 Dec 2016 13:38:55 +0000 (13:38 +0000)
committerZiran Sun <ziran.sun@samsung.com>
Fri, 16 Dec 2016 09:50:58 +0000 (09:50 +0000)
SendSRMResponse response was ignored in the default case handler of svcentityhandler in svcresource.

BUG: https://jira.iotivity.org/browse/IOT-1661
Change-Id: I1c37b8789893d9de46863bfb931047a3c43c473c
Signed-off-by: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15363
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
resource/csdk/security/src/svcresource.c

index d77a75e..6020d71 100644 (file)
@@ -400,8 +400,14 @@ static OCEntityHandlerResult SVCEntityHandler(OCEntityHandlerFlag flag,
                 break;
 
             default:
-                ehRet = OC_EH_ERROR;
-                SendSRMResponse(ehRequest, ehRet, NULL, 0);
+                if (OC_STACK_OK != SendSRMResponse(ehRequest, ehRet, NULL, 0))
+                {
+                    OIC_LOG(ERROR, TAG, "SendSRMResponse failed in HandleSVCPostRequest");
+                }
+                else
+                {
+                    ehRet = OC_EH_OK;
+                }
         }
     }