Index: webrtc/p2p/base/port.cc |
diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc |
index f04e61942682b63de0bb6b8ea70d90fa59bd49c3..90275aa14105688283ce9e397346e4361fb05ae8 100644 |
--- a/webrtc/p2p/base/port.cc |
+++ b/webrtc/p2p/base/port.cc |
@@ -1127,17 +1127,9 @@ bool Connection::dead(uint32_t now) const { |
return false; |
} |
- if (receiving_) { |
- // A connection that is receiving is alive. |
- return false; |
- } |
- |
- // A connection is alive until it is inactive. |
- return !active(); |
- |
- // TODO(honghaiz): Move from using the write state to using the receiving |
- // state with something like the following: |
- // return (now > (last_received() + DEAD_CONNECTION_RECEIVE_TIMEOUT)); |
+ // It is dead if it has not received anything for |
+ // DEAD_CONNECTION_RECEIVE_TIMEOUT milliseconds. |
+ return (now > (last_received() + DEAD_CONNECTION_RECEIVE_TIMEOUT)); |
} |
std::string Connection::ToDebugId() const { |
@@ -1304,7 +1296,7 @@ void Connection::OnMessage(rtc::Message *pmsg) { |
delete this; |
} |
-uint32_t Connection::last_received() { |
+uint32_t Connection::last_received() const { |
return std::max(last_data_received_, |
std::max(last_ping_received_, last_ping_response_received_)); |
} |