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

Unified Diff: webrtc/p2p/base/port.cc

Issue 1422623015: Do not delete a connection until it has not received anything for 30 seconds. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync to head Created 5 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
« no previous file with comments | « webrtc/p2p/base/port.h ('k') | webrtc/p2p/base/port_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_));
}
« no previous file with comments | « webrtc/p2p/base/port.h ('k') | webrtc/p2p/base/port_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698