mirror of
https://github.com/lxsang/ant-http
synced 2025-07-13 13:04:23 +02:00
Xle perf improvement (#1)
* alpha version of proxy * alpha version of proxy * fix method bug * fix post deode bug * regen archive * Reduce CPU usage on idle in proxy mode: - Scheduler timeout event now support millisecond granularity - Use only READABLE event on proxy socket which reduce tasks CPU time * use both readable event and timeout event * reduce scheduler poll time * Fix segmentfault error * Log worker task in statistic * fix high cpu usage when handling bad POST request * fix event-stream handling bug on proxy mode * fix missing data events when uploading * Race condition when get IP address from host in proxy mode - ip_from_hostname() is not thread safe - use global lock mechanism
This commit is contained in:
10
httpd.c
10
httpd.c
@ -297,6 +297,12 @@ void antd_scheduler_ext_statistic(int fd, void *user_data)
|
||||
|
||||
void antd_scheduler_destroy_data(void *data)
|
||||
{
|
||||
antd_request_t *rq = (antd_request_t *)data;
|
||||
antd_client_t *proxy = (antd_client_t *)dvalue(rq->request, "PROXY_HANDLE");
|
||||
if(proxy)
|
||||
{
|
||||
close(proxy->sock);
|
||||
}
|
||||
finish_request(data);
|
||||
}
|
||||
|
||||
@ -306,8 +312,8 @@ int antd_task_data_id(void *data)
|
||||
if(!rq)
|
||||
return 0;
|
||||
return antd_scheduler_next_id(scheduler,rq->client->sock);
|
||||
//UNUSED(data);
|
||||
//return antd_scheduler_next_id(scheduler,0);
|
||||
/*UNUSED(data);
|
||||
return antd_scheduler_next_id(scheduler,0);*/
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
Reference in New Issue
Block a user