Fix bugs in Radio sequence, parameters, add ping/refresh
[src/app-framework-binder.git] / src / http-svc.c
index 0f7f80c..b3b9a1f 100644 (file)
@@ -70,14 +70,10 @@ static AFB_error initLibMagic (AFB_session *session) {
 
 // Because of POST call multiple time requestApi we need to free POST handle here
 static void endRequest (void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe) {
-  AFB_HttpPost *posthandle = *con_cls;
+  AFB_PostHandle *posthandle = *con_cls;
 
   // if post handle was used let's free everything
-  if (posthandle) {
-     if (verbose) fprintf (stderr, "End Post Request UID=%d\n", posthandle->uid);
-     free (posthandle->data);
-     free (posthandle);
-  }
+  if (posthandle != NULL) endPostRequest (posthandle);
 }
 
 
@@ -271,6 +267,9 @@ PUBLIC AFB_error httpdStart(AFB_session *session) {
     apiUrlLen = strlen (session->config->rootapi);
     baseUrlLen= strlen (session->config->rootbase);
     rootUrlLen= strlen (session->config->rootdir);
+    
+    // Initialise Client Session Hash Table
+    ctxStoreInit (CTX_NBCLIENTS);
      
     // TBD open libmagic cache [fail to pass EFENCE check]
     // initLibMagic (session);