OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 WriteState old_value = write_state_; | 918 WriteState old_value = write_state_; |
919 write_state_ = value; | 919 write_state_ = value; |
920 if (value != old_value) { | 920 if (value != old_value) { |
921 LOG_J(LS_VERBOSE, this) << "set_write_state from: " << old_value << " to " | 921 LOG_J(LS_VERBOSE, this) << "set_write_state from: " << old_value << " to " |
922 << value; | 922 << value; |
923 SignalStateChange(this); | 923 SignalStateChange(this); |
924 } | 924 } |
925 } | 925 } |
926 | 926 |
927 void Connection::UpdateReceiving(int64_t now) { | 927 void Connection::UpdateReceiving(int64_t now) { |
928 bool receiving = now <= last_received() + receiving_timeout_; | 928 bool receiving = |
| 929 last_received() > 0 && now <= last_received() + receiving_timeout_; |
929 if (receiving_ == receiving) { | 930 if (receiving_ == receiving) { |
930 return; | 931 return; |
931 } | 932 } |
932 LOG_J(LS_VERBOSE, this) << "set_receiving to " << receiving; | 933 LOG_J(LS_VERBOSE, this) << "set_receiving to " << receiving; |
933 receiving_ = receiving; | 934 receiving_ = receiving; |
934 receiving_unchanged_since_ = now; | 935 receiving_unchanged_since_ = now; |
935 SignalStateChange(this); | 936 SignalStateChange(this); |
936 } | 937 } |
937 | 938 |
938 void Connection::set_state(State state) { | 939 void Connection::set_state(State state) { |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 ASSERT(sent < 0); | 1571 ASSERT(sent < 0); |
1571 error_ = port_->GetError(); | 1572 error_ = port_->GetError(); |
1572 stats_.sent_discarded_packets++; | 1573 stats_.sent_discarded_packets++; |
1573 } else { | 1574 } else { |
1574 send_rate_tracker_.AddSamples(sent); | 1575 send_rate_tracker_.AddSamples(sent); |
1575 } | 1576 } |
1576 return sent; | 1577 return sent; |
1577 } | 1578 } |
1578 | 1579 |
1579 } // namespace cricket | 1580 } // namespace cricket |
OLD | NEW |