diff --git a/samples/net/sockets/big_http_download/src/big_http_download.c b/samples/net/sockets/big_http_download/src/big_http_download.c index 88afa96ccf5..63cabaf4e15 100644 --- a/samples/net/sockets/big_http_download/src/big_http_download.c +++ b/samples/net/sockets/big_http_download/src/big_http_download.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "mbedtls/md.h" @@ -43,6 +44,12 @@ #define MAX_URL_LENGTH 256 #endif +#if defined(CONFIG_SAMPLE_BIG_HTTP_DL_NUM_ITER) +#define NUM_ITER CONFIG_SAMPLE_BIG_HTTP_DL_NUM_ITER +#else +#define NUM_ITER 0 +#endif + /* This URL is parsed in-place, so buffer must be non-const. */ static char download_url[MAX_URL_LENGTH] = #if defined(CONFIG_SAMPLE_BIG_HTTP_DL_URL) @@ -358,7 +365,7 @@ void main(void) unsigned int total_bytes = 0U; int resolve_attempts = 10; bool is_tls = false; - unsigned int num_iterations = CONFIG_SAMPLE_BIG_HTTP_DL_NUM_ITER; + unsigned int num_iterations = NUM_ITER; bool redirect = false; #if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS)