bug 874170 - default npn protocol should be http/1.1 r=hurley

--HG--
extra : rebase_source : 3c772fd36262f9a7bacbfc5d4d3cfe15d700973d
This commit is contained in:
Patrick McManus 2013-05-28 20:09:22 -04:00
parent 54e949897c
commit 7ad5baa466
2 changed files with 10 additions and 2 deletions

View File

@ -383,6 +383,13 @@ nsHttpConnection::SetupNPN(uint32_t caps)
return;
nsTArray<nsCString> protocolArray;
// The first protocol is used as the fallback if none of the
// protocols supported overlap with the server's list.
// In the case of overlap, matching priority is driven by
// the order of the server's advertisement.
protocolArray.AppendElement(NS_LITERAL_CSTRING("http/1.1"));
if (gHttpHandler->IsSpdyEnabled() &&
!(caps & NS_HTTP_DISALLOW_SPDY)) {
LOG(("nsHttpConnection::SetupNPN Allow SPDY NPN selection"));
@ -394,7 +401,6 @@ nsHttpConnection::SetupNPN(uint32_t caps)
gHttpHandler->SpdyInfo()->VersionString[1]);
}
protocolArray.AppendElement(NS_LITERAL_CSTRING("http/1.1"));
if (NS_SUCCEEDED(ssl->SetNPNList(protocolArray))) {
LOG(("nsHttpConnection::Init Setting up SPDY Negotiation OK"));
mNPNComplete = false;

View File

@ -26,7 +26,9 @@ interface nsISSLSocketControl : nsISupports {
tunnel during the SSL handshake. The NPNList is the list
of offered client side protocols. setNPNList() needs to
be called before any data is read or written (including the
handshake to be setup correctly. */
handshake to be setup correctly. The server determines the
priority when multiple matches occur, but if there is no overlap
the first protocol in the list is used. */
[noscript] void setNPNList(in nsCStringTArrayRef aNPNList);