bug 752648 - identify failed ssl handshakes earlier to improve restart logic r=honzab

This commit is contained in:
Patrick McManus 2012-05-09 09:57:04 -04:00
parent 60b399fdb2
commit 67b4fa97a8

View File

@ -309,8 +309,13 @@ nsHttpConnection::EnsureNPNComplete()
PRUint32 count = 0;
rv = mSocketOut->Write("", 0, &count);
if (NS_FAILED(rv) && rv != NS_BASE_STREAM_WOULD_BLOCK)
if (NS_FAILED(rv) && rv != NS_BASE_STREAM_WOULD_BLOCK) {
LOG(("nsHttpConnection::EnsureNPNComplete %p socket write failed "
"with result %X\n", this, rv));
mSocketOutCondition = rv;
goto npnComplete;
}
return false;
}
@ -1247,7 +1252,14 @@ nsHttpConnection::OnSocketWritable()
LOG((" writing transaction request stream\n"));
mProxyConnectInProgress = false;
rv = mTransaction->ReadSegments(this, nsIOService::gDefaultSegmentSize, &n);
if (NS_SUCCEEDED(mSocketOutCondition) ||
mSocketOutCondition == NS_BASE_STREAM_WOULD_BLOCK) {
rv = mTransaction->ReadSegments(this, nsIOService::gDefaultSegmentSize, &n);
}
else {
rv = mSocketOutCondition;
}
}
LOG((" ReadSegments returned [rv=%x read=%u sock-cond=%x]\n",