nshlib: Introduce CONFIG_NSH_WGET_BUFF_SIZE

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2020-05-19 09:00:58 +09:00 committed by patacongo
parent 6a26547dec
commit bd47c468c5
2 changed files with 11 additions and 2 deletions

View File

@ -1121,6 +1121,14 @@ config NSH_NETINIT
---help---
This option enables/disables all network initialization in NSH.
if !NSH_DISABLE_WGET
config NSH_WGET_BUFF_SIZE
int "wget buffer size"
default 512
---help---
Buffer size for wget command
endif # NSH_DISABLE_WGET
endmenu # Networking Configuration"
menu "Telnet Configuration"

View File

@ -1345,7 +1345,7 @@ int cmd_wget(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Allocate an I/O buffer */
buffer = malloc(512);
buffer = malloc(CONFIG_NSH_WGET_BUFF_SIZE);
if (buffer == NULL)
{
fmt = g_fmtcmdoutofmemory;
@ -1354,7 +1354,8 @@ int cmd_wget(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* And perform the wget */
ret = wget(url, buffer, 512, wget_callback, (FAR void *)((intptr_t)fd));
ret = wget(url, buffer, CONFIG_NSH_WGET_BUFF_SIZE,
wget_callback, (FAR void *)((intptr_t)fd));
if (ret < 0)
{
nsh_error(vtbl, g_fmtcmdfailed, argv[0], "wget", NSH_ERRNO);