Speculative connect for HTTPS upgraded page loads has the wrong originAttributes
Categories
(Core :: Networking: HTTP, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox127 | --- | fixed |
People
(Reporter: valentin, Assigned: valentin)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [necko-triaged] [necko-priority-next])
Attachments
(1 file)
I was using the profiler to look at a regression with browser.tabs.documentchannel.parent-controlled
, but I noticed something interesting with speculative connects.
If I open a tab and type wikipedia.org
what happens is that we create a channel and do a speculative connect, that channel later gets upgraded to HTTPS, but the speculative connect is partitioned using the http
scheme of the initial load.
We upgrade the URL to preconnect to the HTTPS url, but the originAttributes keep using http. link here
{ "start": 638713.213607, "end": null, "name": "LogMessages", "category": 1, "threadId": null, "data": { "type": "Log", "module": "nsHttp", "name": "nsHttpConnectionMgr::SpeculativeConnect [ci=.S........[tlsflags0x00000000]wikipedia.org:443^partitionKey=%28http%2Cwikipedia.org%29]\n", "cause": { "tid": 234822, "time": 638713.214095, "stack": 55152 } } }
The result is that the speculative connect probably doesn't get used.
This is a minor fix which is likely to improve perf in a common user interaction.
Comment 1•1 year ago
|
||
I wonder why the default scheme for the url bar is http
?
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
(In reply to Andrew Creskey [:acreskey] from comment #1)
I wonder why the default scheme for the url bar is
http
?
The speculative connect is coming from here
I guess URIFixup.sys.mjs generates a http URL first, and upgrade proceeds knowing http was should be attempted, instead of generating a https URL and falling back to http if that fails. (I'm assuming). We could try to change the default, but I expect that was considered before. See https_first_schemeless.
In any case, just fixing the originAttributes is probably enough.
Assignee | ||
Comment 3•1 year ago
|
||
When entering www.wikipedia.org in the URL bar, that gets fixed up to
being a http URL, and then a speculativeConnect is dispatched.
nsHttpHandler::SpeculativeConnectInternal will upgrade the URL to https,
but the originAttributes in the network partition key also need to be
HTTPS, otherwise the speculative connection will not be used by the
connection manager.
Comment 5•1 year ago
|
||
bugherder |
Description
•