Closed Bug 81336 Opened 24 years ago Closed 24 years ago

nsHttpAuthCache causing assertions when switching profiles

Categories

(Core :: Networking: HTTP, defect)

defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: ccarlen, Assigned: darin.moz)

Details

Attachments

(1 file)

After switching profiles, the assertion comes from the first line of nsHttpAuthCache::GetCredentialsForPath(). When I put in the code to make the HTTP handler observe profile changes, this used to work. Since then, the code in nsHttpHandler::Observe() has changed considerably. nsHttpHandler::Observe now calls mAuthCache->ClearAll() which destroys nsHttpAuthCache's hash table. It is never re-initialized and so we get the assertion. Two ways to fix this: (1) From nsHttpHandler::Observe(), instead of calling a method which destroys the whole hash table, call something which just removes all entries from the hash table. (2) If the auth cache is destroyed on a "profile-before-change" notification, it should be re-initialized so that it's usable again - probably on a "profile-after-change" notification. Darin, you would know best how to solve this - those are just my suggestions.
The assertion is bad enough but this actually causes http auth to fail after a profile switch. Upping severity.
Severity: major → critical
i thought this situation was handled... guess not. should be an easy fix.
Status: NEW → ASSIGNED
Keywords: nsbeta1
Target Milestone: --- → mozilla0.9.1
the fix for this bug is so trivial... i mistakenly left NS_ENSURE_TRUE's at the top of GetCredentialsFor{Path,Domain} and SetCredentials which assert that the auth DB exist. yet, the code inside these functions handles the case of a null DB. so, the fix is just to remove the assertions. ccarlen: can i get an r= from you on this?
Keywords: patch
That works. Thanks for dealing so quickly. r=ccarlen. BTW, those NS_ENSURE_TRUEs do a lot more than assert - they assert and then bail.
r=gagan
rs=mscott
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified per darin's comment.
Status: RESOLVED → VERIFIED
QA Contact: tever → junruh
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: