mirror of
https://github.com/lxsang/ant-http
synced 2024-12-26 16:58:22 +01:00
fix
This commit is contained in:
parent
9b68d1d327
commit
98feff09d6
BIN
dist/antd-1.0.4b.tar.gz
vendored
BIN
dist/antd-1.0.4b.tar.gz
vendored
Binary file not shown.
@ -364,7 +364,7 @@ void *accept_request(void *data)
|
|||||||
token = strsep(&line, " ");
|
token = strsep(&line, " ");
|
||||||
if (!line)
|
if (!line)
|
||||||
{
|
{
|
||||||
LOG("No method found");
|
//LOG("No method found");
|
||||||
antd_error(rq->client, 405, "No method found");
|
antd_error(rq->client, 405, "No method found");
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
@ -375,7 +375,7 @@ void *accept_request(void *data)
|
|||||||
token = strsep(&line, " ");
|
token = strsep(&line, " ");
|
||||||
if (!line)
|
if (!line)
|
||||||
{
|
{
|
||||||
LOG("No request found");
|
//LOG("No request found");
|
||||||
antd_error(rq->client, 400, "Bad request");
|
antd_error(rq->client, 400, "Bad request");
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
@ -407,7 +407,7 @@ void *resolve_request(void *data)
|
|||||||
char *oldrqp = NULL;
|
char *oldrqp = NULL;
|
||||||
strcpy(path, server_config.htdocs);
|
strcpy(path, server_config.htdocs);
|
||||||
strcat(path, url);
|
strcat(path, url);
|
||||||
LOG("Path is : %s", path);
|
//LOG("Path is : %s", path);
|
||||||
//if (path[strlen(path) - 1] == '/')
|
//if (path[strlen(path) - 1] == '/')
|
||||||
// strcat(path, "index.html");
|
// strcat(path, "index.html");
|
||||||
if (stat(path, &st) == -1)
|
if (stat(path, &st) == -1)
|
||||||
@ -477,7 +477,7 @@ void *resolve_request(void *data)
|
|||||||
if (h)
|
if (h)
|
||||||
{
|
{
|
||||||
//sprintf(path,"/%s%s",h,url);
|
//sprintf(path,"/%s%s",h,url);
|
||||||
LOG("WARNING::::Access octetstream via handle %s", h);
|
//LOG("WARNING::::Access octetstream via handle %s", h);
|
||||||
//if(execute_plugin(client,buf,method,rq) < 0)
|
//if(execute_plugin(client,buf,method,rq) < 0)
|
||||||
// cannot_execute(client);
|
// cannot_execute(client);
|
||||||
free(task);
|
free(task);
|
||||||
@ -640,7 +640,7 @@ int startup(unsigned *port)
|
|||||||
error_die("getsockname");
|
error_die("getsockname");
|
||||||
*port = ntohs(name.sin_port);
|
*port = ntohs(name.sin_port);
|
||||||
}
|
}
|
||||||
LOG("back log is %d", server_config.backlog);
|
//LOG("back log is %d", server_config.backlog);
|
||||||
if (listen(httpd, server_config.backlog) < 0)
|
if (listen(httpd, server_config.backlog) < 0)
|
||||||
error_die("listen");
|
error_die("listen");
|
||||||
return (httpd);
|
return (httpd);
|
||||||
@ -728,9 +728,9 @@ void *decode_request_header(void *data)
|
|||||||
//if(line) free(line);
|
//if(line) free(line);
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
strcat(buf, url);
|
strcat(buf, url);
|
||||||
LOG("Original query: %s", url);
|
//LOG("Original query: %s", url);
|
||||||
query = apply_rules(host, buf);
|
query = apply_rules(host, buf);
|
||||||
LOG("Processed query: %s", query);
|
//LOG("Processed query: %s", query);
|
||||||
dput(rq->request, "RESOURCE_PATH", url_decode(buf));
|
dput(rq->request, "RESOURCE_PATH", url_decode(buf));
|
||||||
if (query)
|
if (query)
|
||||||
{
|
{
|
||||||
@ -1095,7 +1095,7 @@ void *decode_multi_part_request_data(void *data)
|
|||||||
// check if end of request
|
// check if end of request
|
||||||
if (line && strstr(line, boundend))
|
if (line && strstr(line, boundend))
|
||||||
{
|
{
|
||||||
LOG("End request %s", boundend);
|
//LOG("End request %s", boundend);
|
||||||
free(line);
|
free(line);
|
||||||
free(boundend);
|
free(boundend);
|
||||||
return task;
|
return task;
|
||||||
@ -1199,7 +1199,7 @@ void *execute_plugin(void *data, const char *pname)
|
|||||||
antd_request_t *rq = (antd_request_t *)data;
|
antd_request_t *rq = (antd_request_t *)data;
|
||||||
antd_task_t *task = antd_create_task(NULL, (void *)rq, NULL, rq->client->last_io);
|
antd_task_t *task = antd_create_task(NULL, (void *)rq, NULL, rq->client->last_io);
|
||||||
task->priority++;
|
task->priority++;
|
||||||
LOG("Plugin name '%s'", pname);
|
//LOG("Plugin name '%s'", pname);
|
||||||
|
|
||||||
//load the plugin
|
//load the plugin
|
||||||
if ((plugin = plugin_lookup((char *)pname)) == NULL)
|
if ((plugin = plugin_lookup((char *)pname)) == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user