summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authorwtc@google.com <wtc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-25 22:15:16 +0000
committerwtc@google.com <wtc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-25 22:15:16 +0000
commit2a5c76b578ec4e35653d24fa5e175e0be78663a1 (patch)
treea6d9fdab7b75e37e49eb20406f46ffeaef81a13c /net/base
parent1f5af444f94761190a16ac6088ad6e6831aeb4a0 (diff)
downloadchromium_src-2a5c76b578ec4e35653d24fa5e175e0be78663a1.zip
chromium_src-2a5c76b578ec4e35653d24fa5e175e0be78663a1.tar.gz
chromium_src-2a5c76b578ec4e35653d24fa5e175e0be78663a1.tar.bz2
If we read nothing (EOF) after sending a request on a
persistent connection, it also indicates that the server closed the connection before receiving the request, and we should resend the request on a new connection. I refactored the main code of HandleIOError into a new ShouldResendRequest method so that I can reuse it to handle the read-nothing case. R=darin BUG=2489 Review URL: http://codereview.chromium.org/4264 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/ssl_client_socket.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/base/ssl_client_socket.cc b/net/base/ssl_client_socket.cc
index 0449eb9..3229c86 100644
--- a/net/base/ssl_client_socket.cc
+++ b/net/base/ssl_client_socket.cc
@@ -159,6 +159,12 @@ void SSLClientSocket::Disconnect() {
}
bool SSLClientSocket::IsConnected() const {
+ // Ideally, we should also check if we have received the close_notify alert
+ // message from the server, and return false in that case. We're not doing
+ // that, so this function may return a false positive. Since the upper
+ // layer (HttpNetworkTransaction) needs to handle a persistent connection
+ // closed by the server when we send a request anyway, a false positive in
+ // exchange for simpler code is a good trade-off.
return completed_handshake_ && transport_->IsConnected();
}