From 3f43c1354e1c1c537c1cae5ef6d0f75019b62174 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 10 Mar 2014 13:32:39 +0000 Subject: [image] Add "--timeout" parameter to image downloading commands iPXE will detect timeout failures in several situations: network link-up, DHCP, TCP connection attempts, unacknowledged TCP data, etc. This does not cover all possible circumstances. For example, if a connection to a web server is successfully established and the web server acknowledges the HTTP request but never sends any data in response, then no timeout will be triggered. There is no timeout defined within the HTTP specifications, and the underlying TCP connection will not generate a timeout since it has no way to know that the HTTP layer is expecting to receive data from the server. Add a "--timeout" parameter to "imgfetch", "chain", etc. If no progress is made (i.e. no data is downloaded) within the timeout period, then the download will be aborted. Signed-off-by: Michael Brown --- src/include/usr/imgmgmt.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/include/usr') diff --git a/src/include/usr/imgmgmt.h b/src/include/usr/imgmgmt.h index 8db5c9780..5e25c562b 100644 --- a/src/include/usr/imgmgmt.h +++ b/src/include/usr/imgmgmt.h @@ -11,9 +11,12 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include -extern int imgdownload ( struct uri *uri, struct image **image ); -extern int imgdownload_string ( const char *uri_string, struct image **image ); -extern int imgacquire ( const char *name, struct image **image ); +extern int imgdownload ( struct uri *uri, unsigned long timeout, + struct image **image ); +extern int imgdownload_string ( const char *uri_string, unsigned long timeout, + struct image **image ); +extern int imgacquire ( const char *name, unsigned long timeout, + struct image **image ); extern void imgstat ( struct image *image ); #endif /* _USR_IMGMGMT_H */ -- cgit v1.2.3-55-g7522