Drop the MAX_CONNS macro and define TCP_CONNECTION_LIMIT, TCP_POLL_CAPACITY, TCP_EVENT_CAPACITY instead
This commit is contained in:
+11
-1
@@ -526,8 +526,8 @@ int socket_manager_wakeup(SocketManager *sm);
|
||||
typedef struct {
|
||||
void **ptrs;
|
||||
struct pollfd *polled;
|
||||
int max_polled;
|
||||
int num_polled;
|
||||
int max_polled;
|
||||
} EventRegister;
|
||||
|
||||
// Resets the event register with the list of descriptors
|
||||
@@ -764,6 +764,11 @@ int http_create_test_certificate(HTTP_String C, HTTP_String O, HTTP_String CN,
|
||||
#define HTTP_CLIENT_CAPACITY (1<<7)
|
||||
#endif
|
||||
|
||||
// Maximum number of descriptors the client will want
|
||||
// to wait on. It's one per connection plus the wakeup
|
||||
// self-pipe.
|
||||
#define HTTP_CLIENT_POLL_CAPACITY (HTTP_CLIENT_CAPACITY+1)
|
||||
|
||||
typedef enum {
|
||||
HTTP_CLIENT_CONN_FREE,
|
||||
HTTP_CLIENT_CONN_WAIT_LINE,
|
||||
@@ -922,6 +927,11 @@ void http_free_response(HTTP_Response *response);
|
||||
#define HTTP_SERVER_CAPACITY (1<<9)
|
||||
#endif
|
||||
|
||||
// Maximum number of descriptors the server will want
|
||||
// to wait on. It's one per connection plus two for the
|
||||
// TCP and TLS listener, plus one for the wakeup self-pipe.
|
||||
#define HTTP_SERVER_POLL_CAPACITY (HTTP_SERVER_CAPACITY+3)
|
||||
|
||||
typedef enum {
|
||||
|
||||
// This struct is unused
|
||||
|
||||
Reference in New Issue
Block a user