From 5f9d79f2903915d69f9ba71173bc6ece117b06e9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Tue, 27 Jun 2017 10:19:02 +0300 Subject: [PATCH] samples: net: http: Remove net_app_init() calls As the net app API is automatically initialized, there is no need to call net_app_init() by the http client and server sample applications. Signed-off-by: Jukka Rissanen --- samples/net/http_client/src/main.c | 5 ----- samples/net/http_server/prj_qemu_x86.conf | 3 +++ samples/net/http_server/src/main.c | 18 ------------------ samples/net/https_client/src/main.c | 5 ----- 4 files changed, 3 insertions(+), 28 deletions(-) diff --git a/samples/net/http_client/src/main.c b/samples/net/http_client/src/main.c index f00ad3ee3b5..1c63787f7ac 100644 --- a/samples/net/http_client/src/main.c +++ b/samples/net/http_client/src/main.c @@ -307,11 +307,6 @@ void main(void) { int ret; - ret = net_app_init("Run HTTP client", 0, APP_STARTUP_TIME); - if (ret < 0) { - panic("Application init failed"); - } - ret = http_client_init(&http_ctx, SERVER_ADDR, SERVER_PORT); if (ret < 0) { NET_ERR("HTTP init failed (%d)", ret); diff --git a/samples/net/http_server/prj_qemu_x86.conf b/samples/net/http_server/prj_qemu_x86.conf index a265188cafd..f98dac92b1b 100644 --- a/samples/net/http_server/prj_qemu_x86.conf +++ b/samples/net/http_server/prj_qemu_x86.conf @@ -37,6 +37,9 @@ CONFIG_NET_APP_SETTINGS=y CONFIG_NET_APP_MY_IPV6_ADDR="2001:db8::1" CONFIG_NET_APP_MY_IPV4_ADDR="192.0.2.1" +CONFIG_NET_APP_NEED_IPV6=y +CONFIG_NET_APP_NEED_IPV4=y + CONFIG_NET_SHELL=y CONFIG_NET_STATISTICS=y diff --git a/samples/net/http_server/src/main.c b/samples/net/http_server/src/main.c index 14b103b3fb4..b88a9c4a4cd 100644 --- a/samples/net/http_server/src/main.c +++ b/samples/net/http_server/src/main.c @@ -270,26 +270,8 @@ static int setup_cert(struct http_server_ctx *ctx, void main(void) { struct sockaddr addr, *server_addr; - u32_t flags = 0; int ret; - /* - * If we have both IPv6 and IPv4 enabled, then set the - * startup flags so that we wait until both are ready - * before continuing. - */ -#if defined(CONFIG_NET_IPV6) - flags |= NET_APP_NEED_IPV6; -#endif -#if defined(CONFIG_NET_IPV4) - flags |= NET_APP_NEED_IPV4; -#endif - - ret = net_app_init(APP_BANNER, flags, APP_STARTUP_TIME); - if (ret < 0) { - panic("Application init failed"); - } - /* * There are several options here for binding to local address. * 1) The server address can be left empty in which case the diff --git a/samples/net/https_client/src/main.c b/samples/net/https_client/src/main.c index 429a493ddc7..835d296cb23 100644 --- a/samples/net/https_client/src/main.c +++ b/samples/net/https_client/src/main.c @@ -370,11 +370,6 @@ void main(void) bool failure = false; int ret; - ret = net_app_init("Run HTTPS client", 0, APP_STARTUP_TIME); - if (ret < 0) { - panic("Application init failed"); - } - ret = https_client_init(&https_ctx, SERVER_ADDR, SERVER_PORT, (u8_t *)INSTANCE_INFO, strlen(INSTANCE_INFO), setup_cert, HOSTNAME, NULL, &ssl_rx_pool,