diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2019-05-18 22:09:28 -0400 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2019-05-29 07:40:56 +0000 |
commit | 68b24e2c9ae80839d15f680959cce31ca3ec2123 (patch) | |
tree | 2ae49e41e5e64509c0dfdeb02b20819d15f97e7b /src/plugins/http_static/http_static_test.c | |
parent | 883a8672c14085b61450599188d04317c45f5d12 (diff) |
plugins: http_static. Migrate to use api string type.
This is not my core competency.
Reviews/feedback/suggestions welcomed. ;)
Tested with:
rv = self.vapi.http_static_enable(
fifo_size = 1,
cache_size_limit = 1000000,
prealloc_fifos = 0,
private_segment_size = 0,
uri="tcp://0.0.0.0/80",
www_root = "/var/tmp/run/vpp/html"
)
DBGvpp# show http static server
www_root /var/tmp/run/vpp/html, cache size 0 bytes, limit 1000000 bytes, evictions 0
Change-Id: I0f660753317ceedab89da1b65701a24d6f7145de
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/plugins/http_static/http_static_test.c')
-rw-r--r-- | src/plugins/http_static/http_static_test.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/http_static/http_static_test.c b/src/plugins/http_static/http_static_test.c index 59cc5f1b29f..0720463cf63 100644 --- a/src/plugins/http_static/http_static_test.c +++ b/src/plugins/http_static/http_static_test.c @@ -155,9 +155,11 @@ api_http_static_enable (vat_main_t * vam) /* Construct the API message */ M (HTTP_STATIC_ENABLE, mp); - clib_strncpy ((char *) mp->www_root, (char *) www_root, - ARRAY_LEN (mp->www_root) - 1); - clib_strncpy ((char *) mp->uri, (char *) uri, ARRAY_LEN (mp->uri) - 1); + vl_api_to_api_string (strnlen ((const char *) www_root, 256), + (const char *) www_root, + (vl_api_string_t *) & mp->www_root); + vl_api_to_api_string (strnlen ((const char *) uri, 256), (const char *) uri, + (vl_api_string_t *) & mp->uri); mp->fifo_size = ntohl (fifo_size); mp->cache_size_limit = ntohl (cache_size_limit); mp->prealloc_fifos = ntohl (prealloc_fifos); |