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

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: '' Created 9 years, 1 month 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
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)
@@ -128,8 +128,7 @@
}
bool SpdyProxyClientSocket::IsConnectedAndIdle() const {
- return IsConnected() && spdy_stream_.get() != NULL &&
- !spdy_stream_->is_idle();
+ return IsConnected() && spdy_stream_ && !spdy_stream_->is_idle();
}
const BoundNetLog& SpdyProxyClientSocket::NetLog() const {
@@ -265,13 +264,15 @@
int SpdyProxyClientSocket::GetPeerAddress(AddressList* address) const {
if (!IsConnected())
return ERR_SOCKET_NOT_CONNECTED;
- return spdy_stream_->GetPeerAddress(address);
+ *address = peer_address_;
wtc 2011/12/01 22:22:15 Is it normal for spdy_stream_ to become NULL when
Ryan Hamilton 2011/12/02 22:24:13 It was, but because of the change you suggested th
+ return OK;
}
int SpdyProxyClientSocket::GetLocalAddress(IPEndPoint* address) const {
if (!IsConnected())
return ERR_SOCKET_NOT_CONNECTED;
- return spdy_stream_->GetLocalAddress(address);
+ *address = local_address_;
+ return OK;
}
void SpdyProxyClientSocket::OnIOComplete(int result) {
@@ -389,6 +390,9 @@
return ERR_TUNNEL_CONNECTION_FAILED;
next_state_ = STATE_OPEN;
+ spdy_stream_->GetPeerAddress(&peer_address_);
+ spdy_stream_->GetLocalAddress(&local_address_);
+
if (net_log_.IsLoggingAllEvents()) {
net_log_.AddEvent(
NetLog::TYPE_HTTP_TRANSACTION_READ_TUNNEL_RESPONSE_HEADERS,

Powered by Google App Engine
This is Rietveld 408576698