From e6f0588a84ba14e585572ba472d23e93f0be1876 Mon Sep 17 00:00:00 2001 From: Dany LE Date: Sun, 21 Aug 2022 18:25:26 +0200 Subject: [PATCH] Update http_server.c --- http_server.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/http_server.c b/http_server.c index f0b4878..f02cd80 100644 --- a/http_server.c +++ b/http_server.c @@ -423,19 +423,20 @@ void *resolve_request(void *data) antd_request_t *rq = (antd_request_t *)data; antd_task_t *task = antd_create_task(NULL, (void *)rq, NULL, rq->client->last_io); char *url = (char *)dvalue(rq->request, "RESOURCE_PATH"); - char *newurl = NULL; - char *rqp = NULL; - char *oldrqp = NULL; + //char *newurl = NULL; + //char *rqp = NULL; + //char *oldrqp = NULL; rq->client->state = ANTD_CLIENT_RESOLVE_REQUEST; htdocs(rq, path); strcat(path, url); - //LOG("Path is : %s", path); + LOG("URL is : %s", url); + LOG("Resource Path is : %s", path); //if (path[strlen(path) - 1] == '/') // strcat(path, "index.html"); if (stat(path, &st) == -1) { free(task); - rqp = strdup((char *)dvalue(rq->request, "REQUEST_PATH")); + rqp = strdup(url); oldrqp = rqp; trim(rqp, '/'); newurl = strsep(&rqp, "/"); @@ -444,6 +445,7 @@ void *resolve_request(void *data) else rqp = strdup(rqp); dput(rq->request, "RESOURCE_PATH", rqp); + LOG("Execute plugin %s", newurl); task = execute_plugin(rq, newurl); free(oldrqp); return task;