diff --git a/examples/wget/Kconfig b/examples/wget/Kconfig index 437ec9471..97c53aa29 100644 --- a/examples/wget/Kconfig +++ b/examples/wget/Kconfig @@ -12,14 +12,22 @@ config EXAMPLES_WGET if EXAMPLES_WGET +config EXAMPLES_WGET_STACKSIZE + int "wget stack size" + default DEFAULT_TASK_STACKSIZE + ---help--- + Stack size of "wget" command. If you use SSL connection, + you should increase this value around 8096. + config EXAMPLES_WGET_URL string "File URL" default "" ---help--- - The URL of the file to get + The URL of the file to get config EXAMPLES_WGET_NOMAC bool "Use Canned MAC Address" + depends on !NSH_NETINIT default n config EXAMPLES_WGET_IPADDR diff --git a/examples/wget/Makefile b/examples/wget/Makefile index cc3e241fe..ecc396625 100644 --- a/examples/wget/Makefile +++ b/examples/wget/Makefile @@ -41,7 +41,7 @@ MAINSRC = wget_main.c PROGNAME = wget PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE) +STACKSIZE = $(CONFIG_EXAMPLES_WGET_STACKSIZE) MODULE = $(CONFIG_EXAMPLES_WGET) include $(APPDIR)/Application.mk diff --git a/examples/wget/wget_main.c b/examples/wget/wget_main.c index 32ed435fa..1f3897bf0 100644 --- a/examples/wget/wget_main.c +++ b/examples/wget/wget_main.c @@ -108,6 +108,7 @@ static void callback(FAR char **buffer, int offset, int datend, int main(int argc, FAR char *argv[]) { +#ifndef CONFIG_NSH_NETINIT struct in_addr addr; #if defined(CONFIG_EXAMPLES_WGET_NOMAC) uint8_t mac[IFHWADDRLEN]; @@ -145,9 +146,18 @@ int main(int argc, FAR char *argv[]) */ netlib_ifup("eth0"); +#endif /* CONFIG_NSH_NETINIT */ /* Then start the server */ - wget(CONFIG_EXAMPLES_WGET_URL, g_iobuffer, 512, callback, NULL); + if (argc > 1) + { + wget(argv[1], g_iobuffer, 512, callback, NULL); + } + else + { + wget(CONFIG_EXAMPLES_WGET_URL, g_iobuffer, 512, callback, NULL); + } + return 0; }