summaryrefslogtreecommitdiffstats
path: root/net/flip/flip_session.cc
diff options
context:
space:
mode:
authormbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 05:13:12 +0000
committermbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 05:13:12 +0000
commit6371bf471df4ae89446c22b924909f09ad034fae (patch)
tree4df5ca128ebd401fe297cd1980ed6e5ed5308d72 /net/flip/flip_session.cc
parentdd1e41a83fc1e11227caffcde580122588c203d2 (diff)
downloadchromium_src-6371bf471df4ae89446c22b924909f09ad034fae.zip
chromium_src-6371bf471df4ae89446c22b924909f09ad034fae.tar.gz
chromium_src-6371bf471df4ae89446c22b924909f09ad034fae.tar.bz2
Fix bug where FLIP sessions can crash if the connect fails.
Update the mocksocket so that we can test connection statuses. Verified that the test case crashes without the flip_session.cc fix. BUG=none TEST=FlipNetworkTransaction.ConnectFailure Review URL: http://codereview.chromium.org/462023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33792 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip/flip_session.cc')
-rw-r--r--net/flip/flip_session.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc
index f501b58..b3b4069 100644
--- a/net/flip/flip_session.cc
+++ b/net/flip/flip_session.cc
@@ -136,6 +136,9 @@ void CreateFlipHeadersFromHttpRequest(
}
}
+ // TODO(mbelshe): Add Proxy headers here. (See http_network_transaction.cc)
+ // TODO(mbelshe): Add authentication headers here.
+
(*headers)["method"] = info.method;
(*headers)["url"] = info.url.spec();
(*headers)["version"] = kHttpProtocolVersion;
@@ -552,8 +555,9 @@ void FlipSession::WriteSocket() {
delayed_write_pending_ = false;
// If the socket isn't connected yet, just wait; we'll get called
- // again when the socket connection completes.
- if (state_ < CONNECTED)
+ // again when the socket connection completes. If the socket is
+ // closed, just return.
+ if (state_ < CONNECTED || state_ == CLOSED)
return;
if (write_pending_) // Another write is in progress still.