mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-10-31 20:18:18 +00:00 
			
		
		
		
	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>
		
			
				
	
	
		
			28 lines
		
	
	
		
			572 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			572 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0
 | |
| #include <net-common.h>
 | |
| 
 | |
| void copy_filename(char *dst, const char *src, int size)
 | |
| {
 | |
| 	if (src && *src && (*src == '"')) {
 | |
| 		++src;
 | |
| 		--size;
 | |
| 	}
 | |
| 
 | |
| 	while ((--size > 0) && src && *src && (*src != '"'))
 | |
| 		*dst++ = *src++;
 | |
| 	*dst = '\0';
 | |
| }
 | |
| 
 | |
| struct wget_http_info default_wget_info = {
 | |
| 	.method = WGET_HTTP_METHOD_GET,
 | |
| 	.set_bootdev = true,
 | |
| };
 | |
| 
 | |
| struct wget_http_info *wget_info;
 | |
| 
 | |
| int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info)
 | |
| {
 | |
| 	wget_info = info ? info : &default_wget_info;
 | |
| 	return wget_do_request(dst_addr, uri);
 | |
| }
 |