diff --git a/chttp.h b/chttp.h index 6c5a168..9419184 100644 --- a/chttp.h +++ b/chttp.h @@ -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 diff --git a/src/client.h b/src/client.h index 21007d3..8aa8c7b 100644 --- a/src/client.h +++ b/src/client.h @@ -5,6 +5,11 @@ #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, diff --git a/src/server.h b/src/server.h index 80bb1df..c99bfa8 100644 --- a/src/server.h +++ b/src/server.h @@ -5,6 +5,11 @@ #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