From 0632549ce98acebf1f8fff9eafdeb885c225fb84 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 28 Feb 2019 00:34:23 +0000 Subject: [PATCH] Doc improvements for websockets_header_size. --- man/mosquitto.conf.5.xml | 11 ++++++----- mosquitto.conf | 13 ++++++------- src/conf.c | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/man/mosquitto.conf.5.xml b/man/mosquitto.conf.5.xml index 3ca2aa57..b4e9ca56 100644 --- a/man/mosquitto.conf.5.xml +++ b/man/mosquitto.conf.5.xml @@ -987,11 +987,12 @@ Change the websockets headers size. This is a global option, it is not possible to set per - listener. This is the value passed to libwebsockets - max_http_header_data which is used for the buffer size - to process HTTP headers. See the libwebsockets documention - for more details. A value of 0 (the default) means to - use libwebsockets' default (which is 1024). + listener. This option sets the size of the buffer + used in the libwebsockets library when reading HTTP + headers. If you are passing large header data such + as cookies then you may need to increase this + value. If left unset, or set to 0, then the default + of 1024 bytes will be used. diff --git a/mosquitto.conf b/mosquitto.conf index dd26faea..c625a46f 100644 --- a/mosquitto.conf +++ b/mosquitto.conf @@ -595,14 +595,13 @@ # libwebsockets documentation for more details. "log_type websockets" must also # be enabled. #websockets_log_level 0 -# + # Change the websockets headers size. This is a global option, it is not -# possible to set per listener. This is the value passed to libwebsockets -# max_http_header_data which is used for the buffer size to process HTTP -# headers. See the libwebsockets documentation for more details. -# A value of 0 (the default) means to use libwebsockets' default (which is -# 1024). -#websockets_headers_size 0 +# possible to set per listener. This option sets the size of the buffer used in +# the libwebsockets library when reading HTTP headers. If you are passing large +# header data such as cookies then you may need to increase this value. If left +# unset, or set to 0, then the default of 1024 bytes will be used. +#websockets_headers_size # If set to true, client connection and disconnection messages will be included # in the log. diff --git a/src/conf.c b/src/conf.c index 9c54bce5..4d65a08b 100644 --- a/src/conf.c +++ b/src/conf.c @@ -2101,11 +2101,11 @@ int config__read_file_core(struct mosquitto__config *config, bool reload, struct #endif }else if(!strcmp(token, "websockets_headers_size")){ #ifdef WITH_WEBSOCKETS -#if defined(LWS_LIBRARY_VERSION_NUMBER) && LWS_LIBRARY_VERSION_NUMBER>=1007000 +# if defined(LWS_LIBRARY_VERSION_NUMBER) && LWS_LIBRARY_VERSION_NUMBER>=1007000 if(conf__parse_int(&token, "websockets_headers_size", &config->websockets_headers_size, saveptr)) return MOSQ_ERR_INVAL; -#else +# else log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Websockets headers size require libwebsocket 1.7+"); -#endif +# endif #else log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Websockets support not available."); #endif