Skip to content
Snippets Groups Projects
Commit fd2e53e0 authored by willchan@chromium.org's avatar willchan@chromium.org
Browse files

Fix preconnect crash on synchronous socket error.

GetAdditionalErrorState() was being called, which stores the error state into the ClientSocketHandle.  When we preconnect, we never have a ClientSocketHandle, so don't bother tryiing to store the error state nor get the error socket.

BUG=69214
TEST=net_unittests

Review URL: http://codereview.chromium.org/6293005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71481 0039d316-1c4b-4281-b951-d872f2087c98
parent 61befb48
No related merge requests found
......@@ -341,8 +341,12 @@ int ClientSocketPoolBaseHelper::RequestSocketInternal(
group->AddJob(connect_job.release());
} else {
LogBoundConnectJobToRequest(connect_job->net_log().source(), request);
connect_job->GetAdditionalErrorState(handle);
ClientSocket* error_socket = connect_job->ReleaseSocket();
ClientSocket* error_socket = NULL;
if (!preconnecting) {
DCHECK(handle);
connect_job->GetAdditionalErrorState(handle);
error_socket = connect_job->ReleaseSocket();
}
if (error_socket) {
HandOutSocket(error_socket, false /* not reused */, handle,
base::TimeDelta(), group, request->net_log());
......
......@@ -2928,6 +2928,13 @@ TEST_F(ClientSocketPoolBaseTest, RequestSocketsSynchronousError) {
BoundNetLog());
ASSERT_FALSE(pool_->HasGroup("a"));
connect_job_factory_->set_job_type(
TestConnectJob::kMockAdditionalErrorStateJob);
pool_->RequestSockets("a", &params_, kDefaultMaxSocketsPerGroup,
BoundNetLog());
ASSERT_FALSE(pool_->HasGroup("a"));
}
TEST_F(ClientSocketPoolBaseTest, RequestSocketsMultipleTimesDoesNothing) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment