mirror of
https://github.com/lxsang/ant-http
synced 2024-11-17 17:08:20 +01:00
use heavy task by default
This commit is contained in:
parent
b0bbff1556
commit
487e5b108b
@ -189,7 +189,7 @@ void *accept_request(void *data)
|
||||
int ret = -1, stat;
|
||||
if (server_config.usessl == 1 && client->status == 0)
|
||||
{
|
||||
if(client->attempt > MAX_ATTEMPT) return task;
|
||||
//if(client->attempt > MAX_ATTEMPT) return task;
|
||||
//LOG("Atttempt %d\n", client->attempt);
|
||||
if (SSL_accept((SSL *)client->ssl) == -1)
|
||||
{
|
||||
@ -203,6 +203,7 @@ void *accept_request(void *data)
|
||||
//LOG("RECALL %d\n", stat);
|
||||
task->handle = accept_request;
|
||||
task->priority = HIGH_PRIORITY;
|
||||
task->type = LIGHT;
|
||||
return task;
|
||||
default:
|
||||
LOG("Error performing SSL handshake %d %d %lu\n", stat, ret, ERR_get_error());
|
||||
|
5
httpd.c
5
httpd.c
@ -148,6 +148,7 @@ int main(int argc, char* argv[])
|
||||
// reclaim data when exit
|
||||
pthread_detach(scheduler_th);
|
||||
}
|
||||
antd_task_t* task = NULL;
|
||||
while (scheduler.status)
|
||||
{
|
||||
client_sock = accept(server_sock,(struct sockaddr *)&client_name,&client_name_len);
|
||||
@ -203,7 +204,9 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
#endif
|
||||
// create callback for the server
|
||||
antd_add_task(&scheduler, antd_create_task(accept_request,(void*)request, finish_request ));
|
||||
task = antd_create_task(accept_request,(void*)request, finish_request );
|
||||
task->type = LIGHT;
|
||||
antd_add_task(&scheduler, task);
|
||||
}
|
||||
|
||||
close(server_sock);
|
||||
|
@ -224,7 +224,7 @@ antd_task_t* antd_create_task(void* (*handle)(void*), void *data, void* (*callba
|
||||
task->handle = handle;
|
||||
task->callback = callback_of(callback);
|
||||
task->priority = NORMAL_PRIORITY;
|
||||
task->type = LIGHT;
|
||||
task->type = HEAVY; //LIGHT;
|
||||
return task;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user