aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/http_static/http_static.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/http_static/http_static.c')
-rw-r--r--src/plugins/http_static/http_static.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/plugins/http_static/http_static.c b/src/plugins/http_static/http_static.c
index 967b8474af8..464fd27e90d 100644
--- a/src/plugins/http_static/http_static.c
+++ b/src/plugins/http_static/http_static.c
@@ -66,7 +66,8 @@ hss_register_url_handler (hss_url_handler_fn fp, const char *url,
*/
static int
hss_enable_api (u32 fifo_size, u32 cache_limit, u32 prealloc_fifos,
- u32 private_segment_size, u8 *www_root, u8 *uri, u32 max_age)
+ u32 private_segment_size, u8 *www_root, u8 *uri, u32 max_age,
+ u32 keepalive_timeout)
{
hss_main_t *hsm = &hss_main;
int rv;
@@ -78,6 +79,7 @@ hss_enable_api (u32 fifo_size, u32 cache_limit, u32 prealloc_fifos,
hsm->www_root = format (0, "%s%c", www_root, 0);
hsm->uri = format (0, "%s%c", uri, 0);
hsm->max_age = max_age;
+ hsm->keepalive_timeout = keepalive_timeout;
if (vec_len (hsm->www_root) < 2)
return VNET_API_ERROR_INVALID_VALUE;
@@ -104,10 +106,10 @@ hss_enable_api (u32 fifo_size, u32 cache_limit, u32 prealloc_fifos,
}
/* API message handler */
-static void vl_api_http_static_enable_t_handler
- (vl_api_http_static_enable_t * mp)
+static void
+vl_api_http_static_enable_v2_t_handler (vl_api_http_static_enable_v2_t *mp)
{
- vl_api_http_static_enable_reply_t *rmp;
+ vl_api_http_static_enable_v2_reply_t *rmp;
hss_main_t *hsm = &hss_main;
int rv;
@@ -117,16 +119,16 @@ static void vl_api_http_static_enable_t_handler
rv = hss_enable_api (ntohl (mp->fifo_size), ntohl (mp->cache_size_limit),
ntohl (mp->prealloc_fifos),
ntohl (mp->private_segment_size), mp->www_root, mp->uri,
- HSS_DEFAULT_MAX_AGE);
+ ntohl (mp->max_age), HSS_DEFAULT_KEEPALIVE_TIMEOUT);
- REPLY_MACRO (VL_API_HTTP_STATIC_ENABLE_REPLY);
+ REPLY_MACRO (VL_API_HTTP_STATIC_ENABLE_V2_REPLY);
}
/* API message handler */
static void
-vl_api_http_static_enable_v2_t_handler (vl_api_http_static_enable_v2_t *mp)
+vl_api_http_static_enable_v3_t_handler (vl_api_http_static_enable_v3_t *mp)
{
- vl_api_http_static_enable_v2_reply_t *rmp;
+ vl_api_http_static_enable_v3_reply_t *rmp;
hss_main_t *hsm = &hss_main;
int rv;
@@ -136,9 +138,9 @@ vl_api_http_static_enable_v2_t_handler (vl_api_http_static_enable_v2_t *mp)
rv = hss_enable_api (ntohl (mp->fifo_size), ntohl (mp->cache_size_limit),
ntohl (mp->prealloc_fifos),
ntohl (mp->private_segment_size), mp->www_root, mp->uri,
- ntohl (mp->max_age));
+ ntohl (mp->max_age), ntohl (mp->keepalive_timeout));
- REPLY_MACRO (VL_API_HTTP_STATIC_ENABLE_V2_REPLY);
+ REPLY_MACRO (VL_API_HTTP_STATIC_ENABLE_V3_REPLY);
}
#include <http_static/http_static.api.c>