diff options
Diffstat (limited to 'src/plugins/http_static/http_static_test.c')
-rw-r--r-- | src/plugins/http_static/http_static_test.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/plugins/http_static/http_static_test.c b/src/plugins/http_static/http_static_test.c index f701c8b9ee7..edb016f9e05 100644 --- a/src/plugins/http_static/http_static_test.c +++ b/src/plugins/http_static/http_static_test.c @@ -39,10 +39,10 @@ http_static_test_main_t http_static_test_main; #include <vlibapi/vat_helper_macros.h> static int -api_http_static_enable (vat_main_t * vam) +api_http_static_enable_v2 (vat_main_t *vam) { unformat_input_t *line_input = vam->input; - vl_api_http_static_enable_t *mp; + vl_api_http_static_enable_v2_t *mp; u64 tmp; u8 *www_root = 0; u8 *uri = 0; @@ -50,6 +50,7 @@ api_http_static_enable (vat_main_t * vam) u32 private_segment_size = 0; u32 fifo_size = 8 << 10; u32 cache_size_limit = 1 << 20; + u32 max_age = HSS_DEFAULT_MAX_AGE; int ret; /* Parse args required to build the message */ @@ -89,7 +90,8 @@ api_http_static_enable (vat_main_t * vam) } cache_size_limit = (u32) tmp; } - + else if (unformat (line_input, "max-age %d", &max_age)) + ; else if (unformat (line_input, "uri %s", &uri)) ; else @@ -108,16 +110,15 @@ api_http_static_enable (vat_main_t * vam) if (uri == 0) uri = format (0, "tcp://0.0.0.0/80%c", 0); - - /* Construct the API message */ - M (HTTP_STATIC_ENABLE, mp); + M (HTTP_STATIC_ENABLE_V2, mp); strncpy_s ((char *) mp->www_root, 256, (const char *) www_root, 256); strncpy_s ((char *) mp->uri, 256, (const char *) uri, 256); mp->fifo_size = ntohl (fifo_size); mp->cache_size_limit = ntohl (cache_size_limit); mp->prealloc_fifos = ntohl (prealloc_fifos); mp->private_segment_size = ntohl (private_segment_size); + mp->max_age = ntohl (max_age); /* send it... */ S (mp); @@ -128,10 +129,10 @@ api_http_static_enable (vat_main_t * vam) } static int -api_http_static_enable_v2 (vat_main_t *vam) +api_http_static_enable_v3 (vat_main_t *vam) { unformat_input_t *line_input = vam->input; - vl_api_http_static_enable_v2_t *mp; + vl_api_http_static_enable_v3_t *mp; u64 tmp; u8 *www_root = 0; u8 *uri = 0; @@ -140,6 +141,7 @@ api_http_static_enable_v2 (vat_main_t *vam) u32 fifo_size = 8 << 10; u32 cache_size_limit = 1 << 20; u32 max_age = HSS_DEFAULT_MAX_AGE; + u32 keepalive_timeout = HSS_DEFAULT_KEEPALIVE_TIMEOUT; int ret; /* Parse args required to build the message */ @@ -181,6 +183,9 @@ api_http_static_enable_v2 (vat_main_t *vam) } else if (unformat (line_input, "max-age %d", &max_age)) ; + else if (unformat (line_input, "keepalive-timeout %d", + &keepalive_timeout)) + ; else if (unformat (line_input, "uri %s", &uri)) ; else @@ -200,7 +205,7 @@ api_http_static_enable_v2 (vat_main_t *vam) uri = format (0, "tcp://0.0.0.0/80%c", 0); /* Construct the API message */ - M (HTTP_STATIC_ENABLE_V2, mp); + M (HTTP_STATIC_ENABLE_V3, mp); strncpy_s ((char *) mp->www_root, 256, (const char *) www_root, 256); strncpy_s ((char *) mp->uri, 256, (const char *) uri, 256); mp->fifo_size = ntohl (fifo_size); @@ -208,6 +213,7 @@ api_http_static_enable_v2 (vat_main_t *vam) mp->prealloc_fifos = ntohl (prealloc_fifos); mp->private_segment_size = ntohl (private_segment_size); mp->max_age = ntohl (max_age); + mp->keepalive_timeout = ntohl (keepalive_timeout); /* send it... */ S (mp); |