aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-08-26 14:45:53 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-08-26 14:45:53 -0700
commit4f989f2478227c426401b27607f3f1bab7476c1c (patch)
tree556ab9b8af4794c857a79ff01cb7ef5d447f3dc9
parent460675909dd059f5fa84985402fcd6490503c884 (diff)
downloadsyslinux-4f989f2478227c426401b27607f3f1bab7476c1c.tar.gz
syslinux-4f989f2478227c426401b27607f3f1bab7476c1c.tar.xz
syslinux-4f989f2478227c426401b27607f3f1bab7476c1c.zip
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>
-rw-r--r--core/fs/pxe/pxe.c14
-rw-r--r--core/keywords1
-rw-r--r--core/keywords.inc1
-rw-r--r--core/parseconfig.inc2
4 files changed, 18 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;
diff --git a/core/keywords b/core/keywords
index c289ae29..7f585b48 100644
--- a/core/keywords
+++ b/core/keywords
@@ -16,6 +16,7 @@ linux
boot
bss
pxe
+pxeretry
fdimage
comboot
com32
diff --git a/core/keywords.inc b/core/keywords.inc
index d0f7db36..7f1404e9 100644
--- a/core/keywords.inc
+++ b/core/keywords.inc
@@ -78,6 +78,7 @@ keywd_table:
keyword noescape, pc_setint16, NoEscape
keyword nocomplete, pc_setint16, NoComplete
keyword nohalt, pc_setint16, NoHalt
+ keyword pxeretry, pc_setint16, PXERetry
keyword f1, pc_filename, FKeyN(1)
keyword f2, pc_filename, FKeyN(2)
keyword f3, pc_filename, FKeyN(3)
diff --git a/core/parseconfig.inc b/core/parseconfig.inc
index e7b3108b..69681d94 100644
--- a/core/parseconfig.inc
+++ b/core/parseconfig.inc
@@ -462,6 +462,8 @@ AllowImplicit dw 1 ; Allow implicit kernels
AllowOptions dw 1 ; User-specified options allowed
IncludeLevel dw 1 ; Nesting level
DefaultLevel dw 0 ; The current level of default
+ global PXERetry
+PXERetry dw 0 ; Extra PXE retries
VKernel db 0 ; Have we seen any "label" statements?
%if IS_PXELINUX