bug 763352 - Proxy/NPN issue r=honzab

--HG--
extra : rebase_source : b4b592d695fe0ddbf5d451b385dc45202d100816
This commit is contained in:
Patrick McManus 2012-06-20 20:55:02 -04:00
parent ff829facbd
commit 7e5038214b

View File

@ -1365,6 +1365,20 @@ nsHttpConnection::OnSocketReadable()
bool again = true;
do {
if (!mProxyConnectInProgress && !mNPNComplete) {
// Unless we are setting up a tunnel via CONNECT, prevent reading
// from the socket until the results of NPN
// negotiation are known (which is determined from the write path).
// If the server speaks SPDY it is likely the readable data here is
// a spdy settings frame and without NPN it would be misinterpreted
// as HTTP/*
LOG(("nsHttpConnection::OnSocketReadable %p return due to inactive "
"tunnel setup but incomplete NPN state\n", this));
rv = NS_OK;
break;
}
rv = mTransaction->WriteSegments(this, nsIOService::gDefaultSegmentSize, &n);
if (NS_FAILED(rv)) {
// if the transaction didn't want to take any more data, then