Closed
Bug 56753
Opened 25 years ago
Closed 25 years ago
user agent misc field can't be changed after handler is initialized
Categories
(Core :: Networking: HTTP, defect, P3)
Core
Networking: HTTP
Tracking
()
RESOLVED
FIXED
People
(Reporter: blizzard, Assigned: blizzard)
References
Details
Attachments
(2 files)
|
1.77 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.01 KB,
patch
|
Details | Diff | Splinter Review |
If you change the pref for the user agent misc field after the HTTP handler has
been initialized the HTTP handler doesn't recognize that and continues to use
the old misc field. This probably doesn't sound like a serious problem at first
but the problem is that the HTTP handler is initialzed very early during
startup. In the case of the embedding api, through some very convouted
dependencies, it's actually initialized before the return from
NS_InitEmbedding(). This means that embedders have no chance to set the misc
field of the HTTP handler.
I'll attach a simple patch that fixes this. I don't think that any of the other
fields of the user agent string should change after initialization.
Comments?
| Assignee | ||
Comment 1•25 years ago
|
||
Comment 4•25 years ago
|
||
sr=mscott
| Assignee | ||
Comment 5•25 years ago
|
||
Checked in. Thanks, guys!
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Chris- version 1.135 causes the assertion on line 1288 on nsHTTPHandler.cpp to
fire. Basically, your call to BuildUserAgent(), line ~1475, is getting executed
before the User Agent Components are intialized (via InitUserAgentComponents())
| Assignee | ||
Comment 7•25 years ago
|
||
The fix here seems to be that we need to initialize the user agent components
before we call PrefsChanged(). I looked at the code paths in the file and it
looks like this should work fine. It's also interesting to note that the locale
prefs change causes this problem, too and I didn't write that code. :) Also,
PrefsChanged() needs an arg - I added a NULL arg since that's what looks like it
needed.
Uploading patch in a sec.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 8•25 years ago
|
||
| Assignee | ||
Comment 9•25 years ago
|
||
gagan, does this look OK to you?
Assignee: gagan → blizzard
Status: REOPENED → NEW
Comment 10•25 years ago
|
||
Blizzard's patch also fixes the same assertion mentioned in bug 56505
| Assignee | ||
Comment 11•25 years ago
|
||
Tao, does the patch look OK to you?
Comment 12•25 years ago
|
||
Looks good. Two minor points:
1. The original code calls PrefsChanged() without arg. Most compilers interpret
it
as NULL. You proposal of calling it w/ NULL (how about nsnull?) sounds
fine to me.
2. Should we register callbacks after PrefsChanged() ?
You'd need Gagan's blessing on this patch since he knows the code best.
Comment 13•25 years ago
|
||
doh... I see the difference now... and this patch addresses the problem of
PrefsChanged being called AFTER the init of prefs. Which seems fine to me. And
blizzard you don't need a NULL (or correctly a nsnull) since PrefsChanged has a
default parameter. r=gagan.
Comment 14•25 years ago
|
||
*** Bug 56505 has been marked as a duplicate of this bug. ***
| Assignee | ||
Comment 15•25 years ago
|
||
I'll check it in without the NULL in the arg. I didn't see the default param
for that function. Thanks!
Comment 16•25 years ago
|
||
I put my super review in 56505 which is a dup of this one by mistake a couple
days ago. Sorry about that. repeating the sr=mscott here
| Assignee | ||
Comment 17•25 years ago
|
||
Checked in. Thanks!
Status: NEW → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•