1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

max_http_header_pool2: migrate context ah pool limit and count to unsigned int

This commit is contained in:
Andy Green 2018-06-19 13:27:54 +08:00
parent 7c6e3a8aeb
commit 4d252d847b
3 changed files with 13 additions and 4 deletions

View file

@ -1375,7 +1375,11 @@ lws_create_context(const struct lws_context_creation_info *info)
if (info->max_http_header_pool)
context->max_http_header_pool = info->max_http_header_pool;
else
context->max_http_header_pool = context->max_fds;
if (info->max_http_header_pool2)
context->max_http_header_pool =
info->max_http_header_pool2;
else
context->max_http_header_pool = context->max_fds;
if (info->fd_limit_per_thread)
context->fd_limit_per_thread = info->fd_limit_per_thread;

View file

@ -655,6 +655,7 @@ struct lws_context {
unsigned int timeout_secs;
unsigned int pt_serv_buf_size;
int max_http_header_data;
int max_http_header_pool;
int simultaneous_ssl_restriction;
int simultaneous_ssl;
#if defined(LWS_WITH_PEER_LIMITS)
@ -681,7 +682,6 @@ struct lws_context {
volatile int service_tid;
int service_tid_detected;
short max_http_header_pool;
short count_threads;
short plugin_protocol_count;
short plugin_extension_count;

View file

@ -2774,10 +2774,10 @@ struct lws_context_creation_info {
void *provided_client_ssl_ctx; /**< dummy if ssl disabled */
#endif
short max_http_header_data;
unsigned short max_http_header_data;
/**< CONTEXT: The max amount of header payload that can be handled
* in an http request (unrecognized header payload is dropped) */
short max_http_header_pool;
unsigned short max_http_header_pool;
/**< CONTEXT: The max number of connections with http headers that
* can be processed simultaneously (the corresponding memory is
* allocated and deallocated dynamically as needed). If the pool is
@ -2997,6 +2997,11 @@ struct lws_context_creation_info {
/**< VHOST: opaque pointer lws ignores but passes to the finalize
* callback. If you don't care, leave it NULL.
*/
unsigned int max_http_header_pool2;
/**< CONTEXT: if max_http_header_pool is 0 and this
* is nonzero, this will be used in place of the default. It's
* like this for compatibility with the original short version:
* this is unsigned int length. */
/* Add new things just above here ---^
* This is part of the ABI, don't needlessly break compatibility