blob: 45288fe5f80298a6099347eb86bf01b7a6e9c5ce [file] [log] [blame]
Jerome Forissier64abd782024-10-16 12:04:00 +02001// SPDX-License-Identifier: GPL-2.0
Adriano Cordova929a5542024-11-11 18:08:57 -03002#include <net-common.h>
Jerome Forissier64abd782024-10-16 12:04:00 +02003
4void copy_filename(char *dst, const char *src, int size)
5{
6 if (src && *src && (*src == '"')) {
7 ++src;
8 --size;
9 }
10
11 while ((--size > 0) && src && *src && (*src != '"'))
12 *dst++ = *src++;
13 *dst = '\0';
14}
Adriano Cordova929a5542024-11-11 18:08:57 -030015
16struct wget_http_info default_wget_info = {
17 .method = WGET_HTTP_METHOD_GET,
18 .set_bootdev = true,
19};
20
21struct wget_http_info *wget_info;
22
23int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info)
24{
25 wget_info = info ? info : &default_wget_info;
26 return wget_with_dns(dst_addr, uri);
27}