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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
305 // because we then get back responses for them, which this code correctly | 305 // because we then get back responses for them, which this code correctly |
306 // does not handle. | 306 // does not handle. |
307 if (msg->type() != STUN_BINDING_RESPONSE) { | 307 if (msg->type() != STUN_BINDING_RESPONSE) { |
308 LOG_J(LS_ERROR, this) << "Received unexpected STUN message type (" | 308 LOG_J(LS_ERROR, this) << "Received unexpected STUN message type (" |
309 << msg->type() << ") from unknown address (" | 309 << msg->type() << ") from unknown address (" |
310 << addr.ToSensitiveString() << ")"; | 310 << addr.ToSensitiveString() << ")"; |
311 } | 311 } |
312 } | 312 } |
313 } | 313 } |
314 | 314 |
315 void Port::OnPacketSent(const rtc::SocketAddress& addr, | |
316 const rtc::SentPacket& sent_packet) { | |
317 Connection* connection = GetConnection(addr); | |
318 if (connection != nullptr) | |
319 connection->OnPacketSent(sent_packet); | |
pthatcher1
2015/10/05 18:30:14
{}s please
pthatcher1
2015/10/05 18:30:14
Do we really need to know which connection it went
stefan-webrtc
2015/10/06 13:00:19
I think this is a good idea, now that I begin unde
pthatcher1
2015/10/06 20:23:55
Yes.
stefan-webrtc
2015/10/07 16:55:25
Done.
| |
320 } | |
321 | |
315 void Port::OnReadyToSend() { | 322 void Port::OnReadyToSend() { |
316 AddressMap::iterator iter = connections_.begin(); | 323 AddressMap::iterator iter = connections_.begin(); |
317 for (; iter != connections_.end(); ++iter) { | 324 for (; iter != connections_.end(); ++iter) { |
318 iter->second->OnReadyToSend(); | 325 iter->second->OnReadyToSend(); |
319 } | 326 } |
320 } | 327 } |
321 | 328 |
322 size_t Port::AddPrflxCandidate(const Candidate& local) { | 329 size_t Port::AddPrflxCandidate(const Candidate& local) { |
323 candidates_.push_back(local); | 330 candidates_.push_back(local); |
324 return (candidates_.size() - 1); | 331 return (candidates_.size() - 1); |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
976 ReceivedPing(); | 983 ReceivedPing(); |
977 break; | 984 break; |
978 | 985 |
979 default: | 986 default: |
980 ASSERT(false); | 987 ASSERT(false); |
981 break; | 988 break; |
982 } | 989 } |
983 } | 990 } |
984 } | 991 } |
985 | 992 |
993 void Connection::OnPacketSent(const rtc::SentPacket& sent_packet) { | |
994 SignalSentPacket(this, sent_packet); | |
995 } | |
996 | |
986 void Connection::OnReadyToSend() { | 997 void Connection::OnReadyToSend() { |
987 if (write_state_ == STATE_WRITABLE) { | 998 if (write_state_ == STATE_WRITABLE) { |
988 SignalReadyToSend(this); | 999 SignalReadyToSend(this); |
989 } | 1000 } |
990 } | 1001 } |
991 | 1002 |
992 void Connection::Prune() { | 1003 void Connection::Prune() { |
993 if (!pruned_ || active()) { | 1004 if (!pruned_ || active()) { |
994 LOG_J(LS_VERBOSE, this) << "Connection pruned"; | 1005 LOG_J(LS_VERBOSE, this) << "Connection pruned"; |
995 pruned_ = true; | 1006 pruned_ = true; |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1411 ASSERT(sent < 0); | 1422 ASSERT(sent < 0); |
1412 error_ = port_->GetError(); | 1423 error_ = port_->GetError(); |
1413 sent_packets_discarded_++; | 1424 sent_packets_discarded_++; |
1414 } else { | 1425 } else { |
1415 send_rate_tracker_.AddSamples(sent); | 1426 send_rate_tracker_.AddSamples(sent); |
1416 } | 1427 } |
1417 return sent; | 1428 return sent; |
1418 } | 1429 } |
1419 | 1430 |
1420 } // namespace cricket | 1431 } // namespace cricket |
OLD | NEW |