Changing the length of access token
[platform/upstream/iotivity.git] / service / easy-setup / enrollee / src / resourcehandler.c
index eb626c8..1156390 100755 (executable)
@@ -426,6 +426,8 @@ void updateWiFiConfResource(OCRepPayload* input)
         OIC_LOG(DEBUG, ES_RH_TAG, "Enrollee doesn't have any observer.");
     }
 
+    OICFree(ssid);
+    OICFree(cred);
     OICFree(wiFiData);
 }
 
@@ -440,7 +442,7 @@ void updateCoapCloudConfResource(OCRepPayload* input)
     }
 
     memset(cloudData->authCode, 0, OIC_STRING_MAX_VALUE);
-    memset(cloudData->accessToken, 0, OIC_STRING_MAX_VALUE);
+    memset(cloudData->accessToken, 0, OIC_STRING_ACCESS_TOKEN_MAX_VALUE);
     g_ESCoapCloudConfResource.accessTokenType = NONE_OAUTH_TOKENTYPE;
     memset(cloudData->authProvider, 0, OIC_STRING_MAX_VALUE);
     memset(cloudData->ciServer, 0, OIC_STRING_MAX_VALUE);
@@ -511,6 +513,10 @@ void updateCoapCloudConfResource(OCRepPayload* input)
         OIC_LOG(DEBUG, ES_RH_TAG, "CoapCloudConf resource doesn't have any observer.");
     }
 
+    OICFree(authCode);
+    OICFree(accessToken);
+    OICFree(authProvider);
+    OICFree(ciServer);
     OICFree(cloudData);
 }
 
@@ -1510,12 +1516,12 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
     {
         if (OC_REST_GET == entityHandlerRequest->method)
         {
-            OIC_LOG(DEBUG, ES_RH_TAG, "Received GET request");
+            OIC_LOG(INFO, ES_RH_TAG, "Received GET request");
             ehRet = ProcessGetRequest(entityHandlerRequest, &payload);
         }
         else if (OC_REST_PUT == entityHandlerRequest->method)
         {
-            OIC_LOG(DEBUG, ES_RH_TAG, "Received PUT request");
+            OIC_LOG(INFO, ES_RH_TAG, "Received PUT request");
 
             //PUT request will be handled in the internal implementation
             if (g_ESEasySetupResource.handle != NULL)
@@ -1530,7 +1536,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
         }
         else if (OC_REST_POST == entityHandlerRequest->method)
         {
-            OIC_LOG(DEBUG, ES_RH_TAG, "Received OC_REST_POST from client");
+            OIC_LOG(INFO, ES_RH_TAG, "Received OC_REST_POST from client");
             if (g_ESEasySetupResource.handle != NULL)
             {
                 ehRet = ProcessPostRequest(entityHandlerRequest, &payload);
@@ -1556,6 +1562,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
         response.persistentBufferFlag = 0;
 
         // Send the response
+        OIC_LOG(INFO, ES_RH_TAG, "Invoking OCDoResponse");
         if (OCDoResponse(&response) != OC_STACK_OK)
         {
             OIC_LOG(ERROR, ES_RH_TAG, "Error sending response");
@@ -1575,6 +1582,8 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
             OIC_LOG(DEBUG, ES_RH_TAG, "Received OC_OBSERVE_DEREGISTER from Mediator");
         }
     }
+
+    OIC_LOG(INFO, ES_RH_TAG, "ES OCEntityHandlerCb OUT");
     return ehRet;
 }