diff options
author | jiayl@webrtc.org <jiayl@webrtc.org> | 2014-10-30 23:50:54 +0000 |
---|---|---|
committer | jiayl@webrtc.org <jiayl@webrtc.org> | 2014-10-30 23:50:54 +0000 |
commit | b4c42cab03e19a3bb58ff8d6d6627ef4dba826a9 (patch) | |
tree | 587750106828d080f59665428fda0eaddbf4da40 | |
parent | abe48e1d79776f94e0ea2ba8545c477d9b318121 (diff) | |
download | talk-b4c42cab03e19a3bb58ff8d6d6627ef4dba826a9.tar.gz |
Improve the logging when a TCP connection is deleted.
BUG=
R=juberti@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/31869004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@7572 4adac7df-926f-26a2-2b94-8c16560cd09d
-rw-r--r-- | p2p/base/port.cc | 2 | ||||
-rw-r--r-- | p2p/base/tcpport.cc | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/p2p/base/port.cc b/p2p/base/port.cc index 7ce01b5..aa88872 100644 --- a/p2p/base/port.cc +++ b/p2p/base/port.cc @@ -1337,7 +1337,7 @@ void Connection::HandleRoleConflictFromPeer() { void Connection::OnMessage(rtc::Message *pmsg) { ASSERT(pmsg->message_id == MSG_DELETE); - LOG_J(LS_INFO, this) << "Connection deleted"; + LOG_J(LS_INFO, this) << "Connection deleted due to read or write timeout"; SignalDestroyed(this); delete this; } diff --git a/p2p/base/tcpport.cc b/p2p/base/tcpport.cc index 30c28c9..aa08a92 100644 --- a/p2p/base/tcpport.cc +++ b/p2p/base/tcpport.cc @@ -304,20 +304,23 @@ void TCPConnection::OnConnect(rtc::AsyncPacketSocket* socket) { // the one we asked for. This is seen in Chrome, where TCP sockets cannot be // given a binding address, and the platform is expected to pick the // correct local address. - if (socket->GetLocalAddress().ipaddr() == port()->ip()) { + const rtc::IPAddress& socket_ip = socket->GetLocalAddress().ipaddr(); + if (socket_ip == port()->ip()) { LOG_J(LS_VERBOSE, this) << "Connection established to " << socket->GetRemoteAddress().ToSensitiveString(); set_connected(true); } else { - LOG_J(LS_WARNING, this) << "Dropping connection as TCP socket bound to a " - << "different address from the local candidate."; + LOG_J(LS_WARNING, this) << "Dropping connection as TCP socket bound to IP " + << socket_ip.ToSensitiveString() + << ", different from the local candidate IP " + << port()->ip().ToSensitiveString(); socket_->Close(); } } void TCPConnection::OnClose(rtc::AsyncPacketSocket* socket, int error) { ASSERT(socket == socket_); - LOG_J(LS_VERBOSE, this) << "Connection closed with error " << error; + LOG_J(LS_INFO, this) << "Connection closed with error " << error; set_connected(false); set_write_state(STATE_WRITE_TIMEOUT); } |