net: wget: let wget_with_dns work with dns disabled
This was marked as TODO in the code:
- Enable use of wget_with_dns even if CMD_DNS is disabled if
the given uri has the ip address for the http server.
- Move the check for CMD_DNS inside wget_with_dns.
- Rename wget_with_dns to wget_do_request
Signed-off-by: Adriano Cordova <adrianox@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
diff --git a/net/lwip/wget.c b/net/lwip/wget.c
index 263d6da..669eded 100644
--- a/net/lwip/wget.c
+++ b/net/lwip/wget.c
@@ -353,7 +353,7 @@
return -1;
}
-int wget_with_dns(ulong dst_addr, char *uri)
+int wget_do_request(ulong dst_addr, char *uri)
{
eth_set_current();
@@ -387,7 +387,7 @@
return CMD_RET_FAILURE;
wget_info = &default_wget_info;
- if (wget_with_dns(dst_addr, nurl))
+ if (wget_do_request(dst_addr, nurl))
return CMD_RET_FAILURE;
return CMD_RET_SUCCESS;