mirror of
https://github.com/lxsang/ant-http
synced 2024-12-25 16:28:21 +01:00
fix deadlock
This commit is contained in:
parent
54bb040ef4
commit
ee5c630052
@ -190,6 +190,7 @@ void *accept_request(void *data)
|
||||
if (server_config.usessl == 1 && client->status == 0)
|
||||
{
|
||||
if(client->attempt > MAX_ATTEMPT) return task;
|
||||
LOG("Atttempt %d\n", client->attempt);
|
||||
if (SSL_accept((SSL *)client->ssl) == -1)
|
||||
{
|
||||
client->attempt++;
|
||||
|
@ -26,7 +26,7 @@
|
||||
#define __RESULT__ "{\"result\":%d,\"msg\":\"%s\"}"
|
||||
#define FORM_URL_ENCODE "application/x-www-form-urlencoded"
|
||||
#define FORM_MULTI_PART "multipart/form-data"
|
||||
#define MAX_ATTEMPT 500
|
||||
#define MAX_ATTEMPT 5000
|
||||
#ifdef USE_OPENSSL
|
||||
int __attribute__((weak)) usessl();
|
||||
#endif
|
||||
|
@ -153,13 +153,13 @@ void antd_scheduler_init(antd_scheduler_t* scheduler, int n)
|
||||
scheduler->workers_queue = NULL;
|
||||
scheduler->pending_task = 0 ;
|
||||
// init semaphore
|
||||
scheduler->scheduler_sem = sem_open("scheduler", O_RDWR | O_CREAT, S_IRWXU);
|
||||
if (!scheduler->scheduler_sem)
|
||||
scheduler->scheduler_sem = sem_open("scheduler", O_CREAT, 0600, 0);
|
||||
if (scheduler->scheduler_sem == SEM_FAILED)
|
||||
{
|
||||
LOG("Cannot open semaphore for scheduler\n");
|
||||
exit(-1);
|
||||
}
|
||||
scheduler->worker_sem = sem_open("worker", O_RDWR | O_CREAT, S_IRWXU);
|
||||
scheduler->worker_sem = sem_open("worker", O_CREAT, 0600, 0);
|
||||
if (!scheduler->worker_sem)
|
||||
{
|
||||
LOG("Cannot open semaphore for workers\n");
|
||||
|
Loading…
Reference in New Issue
Block a user