From 4d7d7f70fd98bcb5e2f8ba7c96c3226998c89960 Mon Sep 17 00:00:00 2001 From: "rjc%netscape.com" Date: Mon, 24 Apr 2000 08:49:59 +0000 Subject: [PATCH] When downloading new search engines/images, check HTTP status against 200 level success. --- .../search/src/nsInternetSearchService.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xpfe/components/search/src/nsInternetSearchService.cpp b/xpfe/components/search/src/nsInternetSearchService.cpp index 6be8e1d9258..6eb0d688269 100755 --- a/xpfe/components/search/src/nsInternetSearchService.cpp +++ b/xpfe/components/search/src/nsInternetSearchService.cpp @@ -3789,7 +3789,17 @@ InternetSearchDataSource::OnStopRequest(nsIChannel* channel, nsISupports *ctxt, if ((contextType == nsIInternetSearchContext::ENGINE_DOWNLOAD_CONTEXT) || (contextType == nsIInternetSearchContext::ICON_DOWNLOAD_CONTEXT)) { - rv = saveContents(channel, context, contextType); + nsCOMPtr 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); }