// 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);
}
// No trailing '/'. Let's add one and redirect for relative paths to work
if (url [strlen (url) -1] != '/') {
response = MHD_create_response_from_buffer(0,"", MHD_RESPMEM_PERSISTENT);
+ strncpy(staticfile->path, url, sizeof (staticfile->path));
strncat(staticfile->path, "/", sizeof (staticfile->path));
MHD_add_response_header (response, "Location", staticfile->path);
MHD_queue_response (connection, MHD_HTTP_MOVED_PERMANENTLY, response);
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);