Bug 1416295 - Support downloading updates from servers that don't support resuming. r=dthayer

MozReview-Commit-ID: Cw0cUibaD3d

--HG--
extra : rebase_source : 002e602a32bdcc28eef28aceeaba3038d93947ee
This commit is contained in:
Matt Howell 2017-11-10 09:54:13 -08:00
Родитель 899e8c96a4
Коммит 2e8f14b5ac
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -3598,7 +3598,15 @@ class ChannelDownloader extends CommonDownloader {
this._bkgFileSaver.onStartRequest(request, context);
if (request instanceof Ci.nsIResumableChannel) {
this._patch.setProperty("entityID", request.entityID);
// Reading the entityID can throw if the server doesn't allow resuming.
try {
this._patch.setProperty("entityID", request.entityID);
} catch (ex) {
if (!(ex instanceof Components.Exception) ||
ex.result != Cr.NS_ERROR_NOT_RESUMABLE) {
throw ex;
}
}
}
var um = Cc["@mozilla.org/updates/update-manager;1"].