From 63a6bde8875d2746c34b470c2a1ca2fffba1fe31 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 29 Sep 2005 00:53:53 +0000 Subject: [PATCH] Make about:cache do something sane when cache is disabled. Bug 207709, patch by Alfred Kayser , r+sr=darin git-svn-id: svn://10.0.0.236/trunk@181190 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/protocol/about/src/nsAboutCache.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mozilla/netwerk/protocol/about/src/nsAboutCache.cpp b/mozilla/netwerk/protocol/about/src/nsAboutCache.cpp index 45f076ba27f..80d083abeff 100644 --- a/mozilla/netwerk/protocol/about/src/nsAboutCache.cpp +++ b/mozilla/netwerk/protocol/about/src/nsAboutCache.cpp @@ -130,13 +130,16 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result) mStream = outputStream; rv = cacheService->VisitEntries(this); - if (NS_FAILED(rv)) return rv; + mBuffer.Truncate(); + if (rv == NS_ERROR_NOT_AVAILABLE) { + mBuffer.AppendLiteral("

The cache is disabled.

\n"); + } + else if (NS_FAILED(rv)) { + return rv; + } if (!mDeviceID.IsEmpty()) { - mBuffer.AssignLiteral("\n"); - } - else { - mBuffer.Truncate(); + mBuffer.AppendLiteral("\n"); } mBuffer.AppendLiteral("\n\n\n"); outputStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);