| Index: net/spdy/spdy_session.cc
|
| ===================================================================
|
| --- net/spdy/spdy_session.cc (revision 181625)
|
| +++ net/spdy/spdy_session.cc (working copy)
|
| @@ -233,7 +233,6 @@
|
| http_server_properties_(http_server_properties),
|
| connection_(new ClientSocketHandle),
|
| read_buffer_(new IOBuffer(kReadBufferSize)),
|
| - read_pending_(false),
|
| stream_hi_water_mark_(kFirstStreamId),
|
| write_pending_(false),
|
| delayed_write_pending_(false),
|
| @@ -782,22 +781,17 @@
|
|
|
| void SpdySession::OnReadComplete(int bytes_read) {
|
| DCHECK_NE(state_, STATE_DO_READ);
|
| - read_pending_ = false;
|
| DoLoop(bytes_read);
|
| }
|
|
|
| void SpdySession::StartRead() {
|
| DCHECK_NE(state_, STATE_DO_READ_COMPLETE);
|
| - read_pending_ = false;
|
| DoLoop(OK);
|
| }
|
|
|
| int SpdySession::DoLoop(int result) {
|
| bytes_read_ = 0;
|
| do {
|
| - if (read_pending_)
|
| - return OK;
|
| -
|
| switch (state_) {
|
| case STATE_DO_READ:
|
| DCHECK_EQ(result, OK);
|
| @@ -819,7 +813,6 @@
|
| }
|
|
|
| int SpdySession::DoRead() {
|
| - DCHECK(!read_pending_);
|
| if (bytes_read_ > kMaxReadBytes) {
|
| state_ = STATE_DO_READ;
|
| MessageLoop::current()->PostTask(
|
| @@ -832,13 +825,10 @@
|
| CHECK(connection_.get());
|
| CHECK(connection_->socket());
|
| state_ = STATE_DO_READ_COMPLETE;
|
| - int result = connection_->socket()->Read(
|
| + return connection_->socket()->Read(
|
| read_buffer_.get(),
|
| kReadBufferSize,
|
| base::Bind(&SpdySession::OnReadComplete, base::Unretained(this)));
|
| - if (result == net::ERR_IO_PENDING)
|
| - read_pending_ = true;
|
| - return result;
|
| }
|
|
|
| int SpdySession::DoReadComplete(int result) {
|
| @@ -846,8 +836,6 @@
|
| // buffer (32KB).
|
| // TODO(mbelshe): support arbitrarily large frames!
|
|
|
| - DCHECK(!read_pending_);
|
| -
|
| if (result <= 0) {
|
| // Session is tearing down.
|
| net::Error error = static_cast<net::Error>(result);
|
|
|