[downloader] Treat redirection failures as fatal

Debugged-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/56/head
Michael Brown 2016-07-04 16:13:25 +01:00
parent 5e2a7481ad
commit 89c6db838f
1 changed files with 6 additions and 2 deletions

View File

@ -190,14 +190,18 @@ static int downloader_vredirect ( struct downloader *downloader, int type,
/* Set image URI */ /* Set image URI */
if ( ( rc = image_set_uri ( downloader->image, uri ) ) != 0 ) if ( ( rc = image_set_uri ( downloader->image, uri ) ) != 0 )
return rc; goto err;
} }
/* Redirect to new location */ /* Redirect to new location */
if ( ( rc = xfer_vreopen ( &downloader->xfer, type, args ) ) != 0 ) if ( ( rc = xfer_vreopen ( &downloader->xfer, type, args ) ) != 0 )
return rc; goto err;
return 0; return 0;
err:
downloader_finished ( downloader, rc );
return rc;
} }
/** Downloader data transfer interface operations */ /** Downloader data transfer interface operations */