X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fhttp_static%2Fhttp_static_test.c;h=0720463cf63a688ceec290e93c3474fd348f372e;hb=68b24e2c9;hp=0a24ce55d6a336b0c2723c6b54a9ed4408af23b8;hpb=22bc2c46e316dd7d5ca4680f85337fe72896ca57;p=vpp.git diff --git a/src/plugins/http_static/http_static_test.c b/src/plugins/http_static/http_static_test.c index 0a24ce55d6a..0720463cf63 100644 --- a/src/plugins/http_static/http_static_test.c +++ b/src/plugins/http_static/http_static_test.c @@ -148,12 +148,6 @@ api_http_static_enable (vat_main_t * vam) return -99; } - if (www_root == 0) - { - errmsg ("Must specify www-root"); - return -99; - } - if (uri == 0) uri = format (0, "tcp://0.0.0.0/80%c", 0); @@ -161,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);