samples: net: big_http_download: Fix POSIX compability
The sample documentation mentions that the sample can be built directly on Linux, which was no longer the case. This commit fixes it. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
2a02f4f9a9
commit
340e7c9f79
1 changed files with 8 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue