diff options
author | Michael Brown | 2014-03-10 14:32:39 +0100 |
---|---|---|
committer | Michael Brown | 2014-03-10 14:32:39 +0100 |
commit | 3f43c1354e1c1c537c1cae5ef6d0f75019b62174 (patch) | |
tree | 4b022f7e92433963a67a7e932b7e7c9dedccf12a /src/include/usr | |
parent | [monojob] Reset timeout when progress is made (diff) | |
download | ipxe-3f43c1354e1c1c537c1cae5ef6d0f75019b62174.tar.gz ipxe-3f43c1354e1c1c537c1cae5ef6d0f75019b62174.tar.xz ipxe-3f43c1354e1c1c537c1cae5ef6d0f75019b62174.zip |
[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 <mcb30@ipxe.org>
Diffstat (limited to 'src/include/usr')
-rw-r--r-- | src/include/usr/imgmgmt.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/include/usr/imgmgmt.h b/src/include/usr/imgmgmt.h index 8db5c978..5e25c562 100644 --- a/src/include/usr/imgmgmt.h +++ b/src/include/usr/imgmgmt.h @@ -11,9 +11,12 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <ipxe/image.h> -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 */ |