mirror of
https://github.com/lxsang/ant-http
synced 2025-07-15 05:19:55 +02:00
limit number of connection at a time
This commit is contained in:
@ -121,6 +121,8 @@ int antd_close(void* src)
|
||||
#endif
|
||||
//printf("Close sock %d\n", source->sock);
|
||||
int ret = close(source->sock);
|
||||
server_config.connection--;
|
||||
LOG("Remaining connection %d\n", server_config.connection);
|
||||
free(src);
|
||||
return ret;
|
||||
}
|
||||
|
@ -39,13 +39,15 @@ typedef struct {
|
||||
list rules;
|
||||
dictionary handlers;
|
||||
int backlog;
|
||||
int maxcon;
|
||||
int connection;
|
||||
#ifdef USE_OPENSSL
|
||||
int usessl;
|
||||
char* sslcert;
|
||||
char* sslkey;
|
||||
#endif
|
||||
}config_t;
|
||||
|
||||
extern config_t server_config;
|
||||
typedef struct{
|
||||
int sock;
|
||||
void* ssl;
|
||||
|
Reference in New Issue
Block a user