Make about:cache do something sane when cache is disabled. Bug 207709, patch
by Alfred Kayser <alfredkayser@nl.ibm.com>, r+sr=darin git-svn-id: svn://10.0.0.236/trunk@181190 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
ecd8640db7
commit
63a6bde887
@ -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…
x
Reference in New Issue
Block a user