diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2010-08-26 14:45:53 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-08-26 14:45:53 -0700 |
commit | 4f989f2478227c426401b27607f3f1bab7476c1c (patch) | |
tree | 556ab9b8af4794c857a79ff01cb7ef5d447f3dc9 /core/fs | |
parent | 460675909dd059f5fa84985402fcd6490503c884 (diff) | |
download | syslinux-4f989f2478227c426401b27607f3f1bab7476c1c.tar.gz |
pxe: add a "pxeretry" option to deal with 404's in web appssyslinux-4.03-pre2
For web downloads, sometimes a mirror site will not be fully synced.
Add an option to retry the open a specific number of times before
giving up.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'core/fs')
-rw-r--r-- | core/fs/pxe/pxe.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c index 0238ed4b..a1e40974 100644 --- a/core/fs/pxe/pxe.c +++ b/core/fs/pxe/pxe.c @@ -642,8 +642,22 @@ static uint32_t pxe_getfssec(struct file *file, char *buf, * @out: the lenght of this file, stores in file->file_len * */ +static void __pxe_searchdir(const char *filename, struct file *file); +extern uint16_t PXERetry; + static void pxe_searchdir(const char *filename, struct file *file) { + int i = PXERetry; + + do { + dprintf("PXE: file = %p, retries left = %d: ", file, i); + __pxe_searchdir(filename, file); + dprintf("%s\n", file->inode ? "ok" : "failed"); + } while (!file->inode && i--); +} + +static void __pxe_searchdir(const char *filename, struct file *file) +{ struct fs_info *fs = file->fs; struct inode *inode; struct pxe_pvt_inode *socket; |