l = hss_listener_get (hs->listener_index);
- if (hs->left_recv > l->max_body_size)
+ if (hs->left_recv > l->max_req_body_size)
{
start_send_data (hs, HTTP_STATUS_CONTENT_TOO_LARGE);
hss_session_disconnect_transport (hs);
l->cache_size = 10 << 20;
l->max_age = HSS_DEFAULT_MAX_AGE;
- l->max_body_size = HSS_DEFAULT_MAX_BODY_SIZE;
+ l->max_req_body_size = HSS_DEFAULT_MAX_BODY_SIZE;
l->rx_buff_thresh = HSS_DEFAULT_RX_BUFFER_THRESH;
l->keepalive_timeout = HSS_DEFAULT_KEEPALIVE_TIMEOUT;
l->flags = 0;
;
else if (unformat (line_input, "max-age %d", &l->max_age))
;
- else if (unformat (line_input, "max-body-size %U", unformat_memory_size,
- &l->max_body_size))
+ else if (unformat (line_input, "max-req-body-size %U",
+ unformat_memory_size, &l->max_req_body_size))
;
else if (unformat (line_input, "rx-buff-thresh %U", unformat_memory_size,
&l->rx_buff_thresh))
;
else if (unformat (line_input, "http1-only"))
l->flags |= HSS_LISTENER_F_HTTP1_ONLY;
+ /* Deprecated */
+ else if (unformat (line_input, "max-body-size %U", unformat_memory_size,
+ &l->max_req_body_size))
+ ;
else
{
error = clib_error_return (0, "unknown input `%U'",
* Enable the static http server
*
* @cliexpar
- * This command enables the static http server. Only the www-root
- * parameter is required
+ * This command enables the static http server. Listeners can be added later
* @clistart
* http static server www-root /tmp/www uri tcp://0.0.0.0/80 cache-size 2m
* @cliend
- * @cliexcmd{http static server www-root <path> [url-handlers]
- * [private-segment-size <nnMG>] [fifo-size <nbytes>] [max-age <nseconds>]
- * [uri <uri>] [ptr-thresh <nn>] [prealloc-fifos <nn>] [debug [nn]]
- * [keepalive-timeout <nn>] [max-body-size <nn>] [http1-only]}
+ * @cliexcmd{http static server [private-segment-size <nnMG>]
+ * [fifo-size <nbytes>] [prealloc-fifos <nn>] [debug <nn>] [uri <uri>]
+ * [www-root <path>] [url-handlers] [cache-size <nn>] [max-age <nseconds>]
+ * [max-req-body-size <nn>] [rx-buff-thresh <nn>] [keepalive-timeout <nn>]
+ * [ptr-thresh <nn>] [http1-only]}
?*/
VLIB_CLI_COMMAND (hss_create_command, static) = {
.path = "http static server",
.short_help =
- "http static server [www-root <path>] [url-handlers]\n"
- "[private-segment-size <nnMG>] [fifo-size <nbytes>] [max-age <nseconds>]\n"
- "[uri <uri>] [ptr-thresh <nn>] [prealloc-fifos <nn>] [debug [nn]]\n"
- "[keepalive-timeout <nn>] [max-body-size <nn>] [http1-only]\n",
+ "http static server [private-segment-size <nnMG>] [fifo-size <nbytes>]\n"
+ "[prealloc-fifos <nn>] [debug <nn>] [uri <uri>] [www-root <path>]\n"
+ "[url-handlers] [cache-size <nn>] [max-age <nseconds>]\n"
+ "[max-req-body-size <nn>] [rx-buff-thresh <nn>] [keepalive-timeout <nn>]\n"
+ "[ptr-thresh <nn>] [http1-only]\n",
.function = hss_create_command_fn,
};
l->cache_size = 10 << 20;
l->max_age = HSS_DEFAULT_MAX_AGE;
- l->max_body_size = HSS_DEFAULT_MAX_BODY_SIZE;
+ l->max_req_body_size = HSS_DEFAULT_MAX_BODY_SIZE;
l->rx_buff_thresh = HSS_DEFAULT_RX_BUFFER_THRESH;
l->keepalive_timeout = HSS_DEFAULT_KEEPALIVE_TIMEOUT;
l->flags = 0;
else if (unformat (line_input, "cache-size %U", unformat_memory_size,
&l->cache_size))
;
+ else if (unformat (line_input, "max-age %d", &l->max_age))
+ ;
+ else if (unformat (line_input, "max-req-body-size %U",
+ unformat_memory_size, &l->max_req_body_size))
+ ;
+ else if (unformat (line_input, "rx-buff-thresh %U", unformat_memory_size,
+ &l->rx_buff_thresh))
+ ;
else if (unformat (line_input, "keepalive-timeout %d",
&l->keepalive_timeout))
;
else if (unformat (line_input, "ptr-thresh %U", unformat_memory_size,
&l->use_ptr_thresh))
;
- else if (unformat (line_input, "max-age %d", &l->max_age))
- ;
+ else if (unformat (line_input, "http1-only"))
+ l->flags |= HSS_LISTENER_F_HTTP1_ONLY;
+ /* Deprecated */
else if (unformat (line_input, "max-body-size %U", unformat_memory_size,
- &l->max_body_size))
- ;
- else if (unformat (line_input, "rx-buff-thresh %U", unformat_memory_size,
- &l->rx_buff_thresh))
+ &l->max_req_body_size))
;
else
{
return error;
}
+/*?
+ * Add static http server listener
+ *
+ * @cliexpar
+ * Add a static http server listener. The listener can be used to
+ * serve static files from the www-root directory or to handle
+ * requests using url handlers.
+ * @clistart
+ * http static listener www-root /tmp/www uri tcp://0.0.0.0/80 cache-size 2m
+ * @cliend
+ * @cliexcmd{http static listener [uri <uri>] [www-root <path>] [url-handlers]
+ * [cache-size <nn>] [max-age <nseconds>] [max-req-body-size <nn>]
+ * [rx-buff-thresh <nn>] [keepalive-timeout <nn>] [ptr-thresh <nn>]
+ * [http1-only]}
+?*/
VLIB_CLI_COMMAND (hss_add_del_listener_command, static) = {
.path = "http static listener",
- .short_help = "http static listener [add|del] uri <uri>\n"
- "[www-root <path>] [url-handlers] [http1-only]\n",
+ .short_help =
+ "http static listener [add|del] [uri <uri>] [www-root <path>]\n"
+ "[url-handlers] [cache-size <nn>] [max-age <nseconds>]\n"
+ "[max-req-body-size <nn>] [rx-buff-thresh <nn>] [keepalive-timeout <nn>]\n"
+ "[ptr-thresh <nn>] [http1-only]\n",
.function = hss_add_del_listener_command_fn,
};