1531 // Kill the current cache entry if we are redirecting 1510 // Kill the current cache entry if we are redirecting 1532 // back to ourself. 1511 // back to ourself. 1533 PRBool redirectingBackToSameURI = PR_FALSE; 1512 PRBool redirectingBackToSameURI = PR_FALSE; 1534 if (mCacheEntry && (mCacheAccess & nsICache::ACCESS_WRITE) && 1513 if (mCacheEntry && (mCacheAccess & nsICache::ACCESS_WRITE) && 1535 NS_SUCCEEDED(mURI->Equals(newURI, &redirectingBackToSameURI)) && 1514 NS_SUCCEEDED(mURI->Equals(newURI, &redirectingBackToSameURI)) && 1536 redirectingBackToSameURI) 1515 redirectingBackToSameURI) 1537 mCacheEntry->Doom(); 1516 mCacheEntry->Doom(); 1538 1517 1539 // move the reference of the old location to the new one if the new 1518 // move the reference of the old location to the new one if the new
1544 rv = newURL->GetRef(ref); 1523 rv = newURL->GetRef(ref); 1545 if (NS_SUCCEEDED(rv) && ref.IsEmpty()) { 1524 if (NS_SUCCEEDED(rv) && ref.IsEmpty()) { 1546 nsCOMPtr<nsIURL> baseURL( do_QueryInterface(mURI, &rv) ); 1525 nsCOMPtr<nsIURL> baseURL( do_QueryInterface(mURI, &rv) ); 1542 if (NS_SUCCEEDED(rv)) { 1521 if (NS_SUCCEEDED(rv)) { 1543 nsCAutoString ref; 1522 nsCAutoString ref; 1544 rv = newURL->GetRef(ref); 1523 rv = newURL->GetRef(ref); 1545 if (NS_SUCCEEDED(rv) && ref.IsEmpty()) { 1524 if (NS_SUCCEEDED(rv) && ref.IsEmpty()) { 1550 newURL->SetRef(ref); 1529 newURL->SetRef(ref); 1531 // Kill the current cache entry if we are redirecting 1510 // Kill the current cache entry if we are redirecting 1532 // back to ourself. 1511 // back to ourself. 1533 PRBool redirectingBackToSameURI = PR_FALSE; 1512 PRBool redirectingBackToSameURI = PR_FALSE; 1534 if (mCacheEntry && (mCacheAccess & nsICache::ACCESS_WRITE) && 1513 if (mCacheEntry && (mCacheAccess & nsICache::ACCESS_WRITE) && 1535 NS_SUCCEEDED(mURI->Equals(newURI, &redirectingBackToSameURI