When downloading new search engines/images, check HTTP status against 200 level success.

This commit is contained in:
rjc%netscape.com 2000-04-24 08:49:59 +00:00
Родитель 5377d5f558
Коммит 4d7d7f70fd
1 изменённых файлов: 11 добавлений и 1 удалений

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

@ -3789,7 +3789,17 @@ InternetSearchDataSource::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
if ((contextType == nsIInternetSearchContext::ENGINE_DOWNLOAD_CONTEXT) || if ((contextType == nsIInternetSearchContext::ENGINE_DOWNLOAD_CONTEXT) ||
(contextType == nsIInternetSearchContext::ICON_DOWNLOAD_CONTEXT)) (contextType == nsIInternetSearchContext::ICON_DOWNLOAD_CONTEXT))
{ {
rv = saveContents(channel, context, contextType); nsCOMPtr<nsIHTTPChannel> httpChannel = do_QueryInterface(channel);
if (httpChannel)
{
// check HTTP status to ensure success
PRUint32 httpStatus = 0;
if (NS_SUCCEEDED(rv = httpChannel->GetResponseStatus(&httpStatus)) &&
(httpStatus == 200))
{
rv = saveContents(channel, context, contextType);
}
}
return(rv); return(rv);
} }