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