mirror of
https://github.com/lxsang/ant-http
synced 2025-01-30 15:32:47 +01:00
add more verbose to log
This commit is contained in:
parent
280ad920e9
commit
56806fb25b
BIN
dist/antd-1.0.5b.tar.gz
vendored
BIN
dist/antd-1.0.5b.tar.gz
vendored
Binary file not shown.
@ -336,6 +336,7 @@ void *accept_request(void *data)
|
|||||||
//server_config.connection++;
|
//server_config.connection++;
|
||||||
read_buf(rq->client, buf, sizeof(buf));
|
read_buf(rq->client, buf, sizeof(buf));
|
||||||
line = buf;
|
line = buf;
|
||||||
|
LOG("Request (%d): %s", rq->client->sock,line);
|
||||||
// get the method string
|
// get the method string
|
||||||
token = strsep(&line, " ");
|
token = strsep(&line, " ");
|
||||||
if (!line)
|
if (!line)
|
||||||
@ -770,7 +771,7 @@ void *decode_request_header(void *data)
|
|||||||
// dirty fix, wait for message to be sent
|
// dirty fix, wait for message to be sent
|
||||||
// 100 ms sleep
|
// 100 ms sleep
|
||||||
usleep(100000);
|
usleep(100000);
|
||||||
return antd_create_task(NULL, (void *)rq, NULL,rq->client->last_io);;
|
return antd_create_task(NULL, (void *)rq, NULL,rq->client->last_io);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -800,7 +801,7 @@ 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 (%d): %s", rq->client->sock, url);
|
||||||
query = apply_rules(pcnf->rules, host, buf);
|
query = apply_rules(pcnf->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));
|
||||||
|
2
httpd.c
2
httpd.c
@ -201,7 +201,7 @@ static void* antd_monitor(port_config_t* pcnf)
|
|||||||
if (client_name.sin_family == AF_INET)
|
if (client_name.sin_family == AF_INET)
|
||||||
{
|
{
|
||||||
client_ip = inet_ntoa(client_name.sin_addr);
|
client_ip = inet_ntoa(client_name.sin_addr);
|
||||||
LOG("Connect to client IP: %s on port:%d", client_ip, pcnf->port);
|
LOG("Connect to client IP: %s on port:%d (%d)", client_ip, pcnf->port, client_sock);
|
||||||
// ip address
|
// ip address
|
||||||
dput(xheader, "REMOTE_ADDR", (void *)strdup(client_ip));
|
dput(xheader, "REMOTE_ADDR", (void *)strdup(client_ip));
|
||||||
//LOG("socket: %d\n", client_sock);
|
//LOG("socket: %d\n", client_sock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user