fixes bug 314239 "SU downloader cannot handle redirects when not making a range request" r+sr=bzbarsky

This commit is contained in:
darin%meer.net 2005-10-28 19:45:48 +00:00
Родитель cfcd60ad91
Коммит a20f75c1de
1 изменённых файлов: 9 добавлений и 6 удалений

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

@ -742,15 +742,18 @@ nsIncrementalDownload::OnChannelRedirect(nsIChannel *oldChannel,
NS_NAMED_LITERAL_CSTRING(rangeHdr, "Range"); NS_NAMED_LITERAL_CSTRING(rangeHdr, "Range");
nsresult rv = NS_OK;
// If we didn't have a Range header, then we must be doing a full download.
nsCAutoString rangeVal; nsCAutoString rangeVal;
http->GetRequestHeader(rangeHdr, rangeVal); http->GetRequestHeader(rangeHdr, rangeVal);
NS_ENSURE_STATE(!rangeVal.IsEmpty()); if (!rangeVal.IsEmpty()) {
http = do_QueryInterface(newChannel);
NS_ENSURE_STATE(http);
http = do_QueryInterface(newChannel); rv = http->SetRequestHeader(rangeHdr, rangeVal, PR_FALSE);
NS_ENSURE_STATE(http); NS_ENSURE_SUCCESS(rv, rv);
}
nsresult rv = http->SetRequestHeader(rangeHdr, rangeVal, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
// Give the observer a chance to see this redirect notification. // Give the observer a chance to see this redirect notification.
nsCOMPtr<nsIChannelEventSink> sink = do_GetInterface(mObserver); nsCOMPtr<nsIChannelEventSink> sink = do_GetInterface(mObserver);