diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2020-02-26 17:21:01 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2020-02-26 17:21:01 +0200 |
commit | dd6380a70bd223424e4195add16b6ace45841e48 (patch) | |
tree | affda777f3c98c93a88051befb272dcd88b6d7c3 /src | |
parent | 1b5538d13b13b1bc15c686084abb4eaa9deadc3c (diff) | |
download | ping903-dd6380a70bd223424e4195add16b6ace45841e48.tar.gz ping903-dd6380a70bd223424e4195add16b6ace45841e48.tar.bz2 |
Configure httpd backlog
* src/config.c: New statement "http-backlog-size"
* src/ping903.c (ping903): Pass "http-backlog-size" to the
httpd initialization routine.
* src/ping903.h (httpd_backlog_size): New extern.
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 1 | ||||
-rw-r--r-- | src/ping903.c | 2 | ||||
-rw-r--r-- | src/ping903.h | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index bff22ca..da8e0f2 100644 --- a/src/config.c +++ b/src/config.c @@ -165,6 +165,7 @@ struct cf_stmt statements[] = { { "syslog-facility", STMT_T_CALLBACK, NULL, cf_syslog_facility }, { "access-log", STMT_T_BOOL, &httpd_access_log }, { "access-log-verbose", STMT_T_BOOL, &httpd_log_verbose }, + { "http-backlog-size", STMT_T_ULONG, &httpd_backlog_size }, { NULL } }; diff --git a/src/ping903.c b/src/ping903.c index 287b46b..7bfc77a 100644 --- a/src/ping903.c +++ b/src/ping903.c @@ -33,6 +33,7 @@ char *httpd_addr; int httpd_access_log = 0; int httpd_log_verbose = 0; +unsigned int httpd_backlog_size = SOMAXCONN; static int open_node(char const *node, char const *serv, struct sockaddr **saddr) @@ -680,6 +681,7 @@ ping903(void) p903_httpd_handler, NULL, MHD_OPTION_LISTEN_SOCKET, fd, MHD_OPTION_EXTERNAL_LOGGER, p903_httpd_logger, NULL, + MHD_OPTION_LISTEN_BACKLOG_SIZE, httpd_backlog_size, MHD_OPTION_END); /* Unblock only the fatal signals */ diff --git a/src/ping903.h b/src/ping903.h index 62bd054..2c78c1c 100644 --- a/src/ping903.h +++ b/src/ping903.h @@ -128,6 +128,7 @@ extern unsigned long ping_interval; extern unsigned long ping_count; extern unsigned long ping_tolerance; extern size_t data_length; +extern unsigned int httpd_backlog_size; struct json_value *config_to_json(void); int get_hostname_stat(char const *name, struct json_value **retval); |