Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: net/spdy/spdy_proxy_client_socket.cc

Issue 8771012: Fix crash bug in SpdyProxyClientSocket.GetPeerAddress where (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Really final, I hope2 Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_proxy_client_socket.h ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_proxy_client_socket.cc
===================================================================
--- net/spdy/spdy_proxy_client_socket.cc (revision 112347)
+++ net/spdy/spdy_proxy_client_socket.cc (working copy)
@@ -44,7 +44,6 @@
user_buffer_(NULL),
write_buffer_len_(0),
write_bytes_outstanding_(0),
- eof_has_been_read_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
net_log_(spdy_stream->net_log()) {
request_.method = "CONNECT";
@@ -124,12 +123,11 @@
}
bool SpdyProxyClientSocket::IsConnected() const {
- return next_state_ == STATE_OPEN || next_state_ == STATE_CLOSED;
+ return next_state_ == STATE_OPEN;
}
bool SpdyProxyClientSocket::IsConnectedAndIdle() const {
- return IsConnected() && spdy_stream_.get() != NULL &&
- !spdy_stream_->is_idle();
+ return IsConnected() && read_buffer_.empty() && spdy_stream_->is_idle();
}
const BoundNetLog& SpdyProxyClientSocket::NetLog() const {
@@ -168,10 +166,7 @@
if (next_state_ == STATE_DISCONNECTED)
return ERR_SOCKET_NOT_CONNECTED;
- if (!spdy_stream_ && read_buffer_.empty()) {
- if (eof_has_been_read_)
- return ERR_CONNECTION_CLOSED;
- eof_has_been_read_ = true;
+ if (next_state_ == STATE_CLOSED && read_buffer_.empty()) {
return 0;
}
@@ -212,12 +207,10 @@
int SpdyProxyClientSocket::Write(IOBuffer* buf, int buf_len,
OldCompletionCallback* callback) {
DCHECK(!write_callback_);
- if (next_state_ == STATE_DISCONNECTED)
+ if (next_state_ != STATE_OPEN)
return ERR_SOCKET_NOT_CONNECTED;
- if (!spdy_stream_)
- return ERR_CONNECTION_CLOSED;
-
+ DCHECK(spdy_stream_);
write_bytes_outstanding_= buf_len;
if (buf_len <= kMaxSpdyFrameChunkSize) {
int rv = spdy_stream_->WriteStreamData(buf, buf_len, spdy::DATA_FLAG_NONE);
« no previous file with comments | « net/spdy/spdy_proxy_client_socket.h ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698