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

Unified Diff: content/browser/renderer_host/p2p/socket_host_tcp.cc

Issue 976903002: IPEndPoint::ToString should not crash when the IP address is empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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 | « no previous file | net/base/ip_endpoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/p2p/socket_host_tcp.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp.cc b/content/browser/renderer_host/p2p/socket_host_tcp.cc
index 99d29ef1edd184ff829e50c53ae74deda1909d6b..e6402544a08501806fcf3f7528c66aed30760ebb 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc
@@ -142,6 +142,7 @@ void P2PSocketHostTcpBase::OnConnected(int result) {
DCHECK_NE(result, net::ERR_IO_PENDING);
if (result != net::OK) {
+ LOG(WARNING) << "Error from connecting socket, result=" << result;
OnError();
return;
}
@@ -206,6 +207,8 @@ void P2PSocketHostTcpBase::StartTls() {
int status = socket_->Connect(
base::Bind(&P2PSocketHostTcpBase::ProcessTlsSslConnectDone,
base::Unretained(this)));
+
+ LOG(1) << "StartTls socket connect status is " << status;
if (status != net::ERR_IO_PENDING) {
ProcessTlsSslConnectDone(status);
}
@@ -215,6 +218,7 @@ void P2PSocketHostTcpBase::ProcessTlsSslConnectDone(int status) {
DCHECK_NE(status, net::ERR_IO_PENDING);
DCHECK_EQ(state_, STATE_TLS_CONNECTING);
if (status != net::OK) {
+ LOG(WARNING) << "Error from connecting TLS socket, status=" << status;
OnError();
return;
}
@@ -265,11 +269,13 @@ bool P2PSocketHostTcpBase::DoSendSocketCreateMsg() {
OnError();
return false;
}
- VLOG(1) << "Remote address: " << remote_address.ToString();
- if (remote_address_.ip_address.address().empty() &&
- !remote_address.address().empty()) {
- // Save |remote_address| if address is empty.
- remote_address_.ip_address = remote_address;
+
+ if (!remote_address.address().empty()) {
+ VLOG(1) << "Remote address: " << remote_address.ToString();
+ if (remote_address_.ip_address.address().empty()) {
+ // Save |remote_address| if address is empty.
+ remote_address_.ip_address = remote_address;
+ }
}
// If we are not doing TLS, we are ready to send data now.
« no previous file with comments | « no previous file | net/base/ip_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698