mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Make about:cache do something sane when cache is disabled. Bug 207709, patch
by Alfred Kayser <alfredkayser@nl.ibm.com>, r+sr=darin
This commit is contained in:
parent
99bbb4116a
commit
339344c671
@ -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("<h2>The cache is disabled.</h2>\n");
|
||||
}
|
||||
else if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (!mDeviceID.IsEmpty()) {
|
||||
mBuffer.AssignLiteral("</pre>\n");
|
||||
}
|
||||
else {
|
||||
mBuffer.Truncate();
|
||||
mBuffer.AppendLiteral("</pre>\n");
|
||||
}
|
||||
mBuffer.AppendLiteral("</div>\n</body>\n</html>\n");
|
||||
outputStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);
|
||||
|
Loading…
Reference in New Issue
Block a user