summaryrefslogtreecommitdiffstats
path: root/src/core/downloader.c
diff options
context:
space:
mode:
authorMichael Brown2016-07-04 17:13:25 +0200
committerMichael Brown2016-07-04 17:20:01 +0200
commit89c6db838fc795c113e0584de0230cf86225135b (patch)
tree2d9f0dc86aeef2f0129788b9d0fd1ee6459f88af /src/core/downloader.c
parent[xfer] Send intf_close() if redirection fails (diff)
downloadipxe-89c6db838fc795c113e0584de0230cf86225135b.tar.gz
ipxe-89c6db838fc795c113e0584de0230cf86225135b.tar.xz
ipxe-89c6db838fc795c113e0584de0230cf86225135b.zip
[downloader] Treat redirection failures as fatal
Debugged-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/downloader.c')
-rw-r--r--src/core/downloader.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/downloader.c b/src/core/downloader.c
index ba678f86..35b5b0ac 100644
--- a/src/core/downloader.c
+++ b/src/core/downloader.c
@@ -190,14 +190,18 @@ static int downloader_vredirect ( struct downloader *downloader, int type,
/* Set image URI */
if ( ( rc = image_set_uri ( downloader->image, uri ) ) != 0 )
- return rc;
+ goto err;
}
/* Redirect to new location */
if ( ( rc = xfer_vreopen ( &downloader->xfer, type, args ) ) != 0 )
- return rc;
+ goto err;
return 0;
+
+ err:
+ downloader_finished ( downloader, rc );
+ return rc;
}
/** Downloader data transfer interface operations */