http_static: misc bug fixes

The request vector generated by hss_ts_rx_callback() must be NULL
terminated.

The hss_main_t use_ptr_thresh member must be a u64 since
unformat_memory_size() expects it. Otherwise, the adjacent u8
enable_url_handlers may have an accident.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2cc08e3cbd31b225fb03799283c055515add13bf
This commit is contained in:
Dave Barach
2022-12-06 19:53:15 -05:00
committed by Florin Coras
parent bd9cde810b
commit 287c1252c1
2 changed files with 3 additions and 1 deletions

View File

@@ -145,7 +145,7 @@ typedef struct
/** The bind URI, defaults to tcp://0.0.0.0/80 */
u8 *uri;
/** Threshold for switching to ptr data in http msgs */
u32 use_ptr_thresh;
u64 use_ptr_thresh;
/** Enable the use of builtinurls */
u8 enable_url_handlers;
/** Max cache size before LRU occurs */

View File

@@ -384,6 +384,8 @@ hss_ts_rx_callback (session_t *ts)
vec_validate (request, msg.data.len - 1);
rv = svm_fifo_dequeue (ts->rx_fifo, msg.data.len, request);
ASSERT (rv == msg.data.len);
/* request must be a proper C-string in addition to a vector */
vec_add1 (request, 0);
}
/* Find and send data */