bug 406767 clear invalid cache entries, p=Michal Novotny, r/sr=bzbarsky, a=dveditz
git-svn-id: svn://10.0.0.236/trunk@255769 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
e3f2bb3ea4
commit
e8bb24352b
@ -1117,6 +1117,7 @@ nsFtpState::R_list() {
|
||||
if (mResponseCode/100 == 2) {
|
||||
//(DONE)
|
||||
mNextState = FTP_COMPLETE;
|
||||
mDoomCache = PR_FALSE;
|
||||
return FTP_COMPLETE;
|
||||
}
|
||||
return FTP_ERROR;
|
||||
@ -1940,6 +1941,7 @@ nsFtpState::OnCacheEntryAvailable(nsICacheEntryDescriptor *entry,
|
||||
if (IsClosed())
|
||||
return NS_OK;
|
||||
|
||||
mDoomCache = PR_TRUE;
|
||||
mCacheEntry = entry;
|
||||
if (CanReadCacheEntry() && ReadCacheEntry()) {
|
||||
mState = FTP_READ_CACHE;
|
||||
@ -2020,6 +2022,8 @@ nsFtpState::CloseWithStatus(nsresult status)
|
||||
}
|
||||
|
||||
mDataStream = nsnull;
|
||||
if (mDoomCache && mCacheEntry)
|
||||
mCacheEntry->Doom();
|
||||
mCacheEntry = nsnull;
|
||||
|
||||
return nsBaseContentStream::CloseWithStatus(status);
|
||||
@ -2072,6 +2076,7 @@ nsFtpState::ReadCacheEntry()
|
||||
if (HasPendingCallback())
|
||||
mDataStream->AsyncWait(this, 0, 0, CallbackTarget());
|
||||
|
||||
mDoomCache = PR_FALSE;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
@ -2129,8 +2134,10 @@ nsFtpState::CheckCache()
|
||||
|
||||
session->OpenCacheEntry(key, accessReq, PR_FALSE,
|
||||
getter_AddRefs(mCacheEntry));
|
||||
if (mCacheEntry)
|
||||
if (mCacheEntry) {
|
||||
mDoomCache = PR_TRUE;
|
||||
return PR_FALSE; // great, we're ready to proceed!
|
||||
}
|
||||
|
||||
nsresult rv = session->AsyncOpenCacheEntry(key, accessReq, this);
|
||||
return NS_SUCCEEDED(rv);
|
||||
|
||||
@ -289,6 +289,7 @@ private:
|
||||
nsCString mControlReadCarryOverBuf;
|
||||
|
||||
nsCOMPtr<nsICacheEntryDescriptor> mCacheEntry;
|
||||
PRPackedBool mDoomCache;
|
||||
|
||||
nsCString mSuppliedEntityID;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user