summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_stream.cc
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-02 00:57:55 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-02 00:57:55 +0000
commit8918d28e93f3ee8f64faf143a677788b8cf74b1e (patch)
tree4cc4d46559cd39966ee3f084cb13be21d69e2ec9 /net/spdy/spdy_stream.cc
parent8fcf88422bb276ff9cbaef522667667ddf50b21c (diff)
downloadchromium_src-8918d28e93f3ee8f64faf143a677788b8cf74b1e.zip
chromium_src-8918d28e93f3ee8f64faf143a677788b8cf74b1e.tar.gz
chromium_src-8918d28e93f3ee8f64faf143a677788b8cf74b1e.tar.bz2
Fix a bug with buffering when the connection closes
while the read is still pending. BUG=none TEST=SpdyNetworkTransactionTest Review URL: http://codereview.chromium.org/661292 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40333 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_stream.cc')
-rw-r--r--net/spdy/spdy_stream.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index 23f3b47..2517962 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -371,6 +371,10 @@ bool SpdyStream::ShouldWaitForMoreBufferedData() const {
void SpdyStream::DoBufferedReadCallback() {
buffered_read_callback_pending_ = false;
+ // If the response_status_ is not ok, we don't attempt to complete the read.
+ if (response_status_ != OK)
+ return;
+
// When more_read_data_pending_ is true, it means that more data has
// arrived since we started waiting. Wait a little longer and continue
// to buffer.
@@ -385,10 +389,8 @@ void SpdyStream::DoBufferedReadCallback() {
CHECK(rv != ERR_IO_PENDING);
user_buffer_ = NULL;
user_buffer_len_ = 0;
- }
-
- if (user_callback_)
DoCallback(rv);
+ }
}
void SpdyStream::DoCallback(int rv) {