| 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 size_t index, | 880 size_t index, |
| 881 const Candidate& remote_candidate) | 881 const Candidate& remote_candidate) |
| 882 : port_(port), | 882 : port_(port), |
| 883 local_candidate_index_(index), | 883 local_candidate_index_(index), |
| 884 remote_candidate_(remote_candidate), | 884 remote_candidate_(remote_candidate), |
| 885 read_state_(STATE_READ_INIT), | 885 read_state_(STATE_READ_INIT), |
| 886 write_state_(STATE_WRITE_INIT), | 886 write_state_(STATE_WRITE_INIT), |
| 887 connected_(true), | 887 connected_(true), |
| 888 pruned_(false), | 888 pruned_(false), |
| 889 use_candidate_attr_(false), | 889 use_candidate_attr_(false), |
| 890 received_use_candidate_(false), |
| 890 remote_ice_mode_(ICEMODE_FULL), | 891 remote_ice_mode_(ICEMODE_FULL), |
| 891 requests_(port->thread()), | 892 requests_(port->thread()), |
| 892 rtt_(DEFAULT_RTT), | 893 rtt_(DEFAULT_RTT), |
| 893 last_ping_sent_(0), | 894 last_ping_sent_(0), |
| 894 last_ping_received_(0), | 895 last_ping_received_(0), |
| 895 last_data_received_(0), | 896 last_data_received_(0), |
| 896 last_ping_response_received_(0), | 897 last_ping_response_received_(0), |
| 897 sent_packets_discarded_(0), | 898 sent_packets_discarded_(0), |
| 898 sent_packets_total_(0), | 899 sent_packets_total_(0), |
| 899 reported_(false), | 900 reported_(false), |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 port_->SendBindingResponse(msg.get(), addr); | 1050 port_->SendBindingResponse(msg.get(), addr); |
| 1050 | 1051 |
| 1051 // If timed out sending writability checks, start up again | 1052 // If timed out sending writability checks, start up again |
| 1052 if (!pruned_ && (write_state_ == STATE_WRITE_TIMEOUT)) | 1053 if (!pruned_ && (write_state_ == STATE_WRITE_TIMEOUT)) |
| 1053 set_write_state(STATE_WRITE_INIT); | 1054 set_write_state(STATE_WRITE_INIT); |
| 1054 | 1055 |
| 1055 if ((port_->IsStandardIce()) && | 1056 if ((port_->IsStandardIce()) && |
| 1056 (port_->GetIceRole() == ICEROLE_CONTROLLED)) { | 1057 (port_->GetIceRole() == ICEROLE_CONTROLLED)) { |
| 1057 const StunByteStringAttribute* use_candidate_attr = | 1058 const StunByteStringAttribute* use_candidate_attr = |
| 1058 msg->GetByteString(STUN_ATTR_USE_CANDIDATE); | 1059 msg->GetByteString(STUN_ATTR_USE_CANDIDATE); |
| 1059 if (use_candidate_attr) | 1060 if (use_candidate_attr) { |
| 1061 set_received_use_candidate(true); |
| 1060 SignalUseCandidate(this); | 1062 SignalUseCandidate(this); |
| 1063 } |
| 1061 } | 1064 } |
| 1062 } else { | 1065 } else { |
| 1063 // The packet had the right local username, but the remote username | 1066 // The packet had the right local username, but the remote username |
| 1064 // was not the right one for the remote address. | 1067 // was not the right one for the remote address. |
| 1065 LOG_J(LS_ERROR, this) | 1068 LOG_J(LS_ERROR, this) |
| 1066 << "Received STUN request with bad remote username " | 1069 << "Received STUN request with bad remote username " |
| 1067 << remote_ufrag; | 1070 << remote_ufrag; |
| 1068 port_->SendBindingErrorResponse(msg.get(), addr, | 1071 port_->SendBindingErrorResponse(msg.get(), addr, |
| 1069 STUN_ERROR_UNAUTHORIZED, | 1072 STUN_ERROR_UNAUTHORIZED, |
| 1070 STUN_ERROR_REASON_UNAUTHORIZED); | 1073 STUN_ERROR_REASON_UNAUTHORIZED); |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1556 ASSERT(sent < 0); | 1559 ASSERT(sent < 0); |
| 1557 error_ = port_->GetError(); | 1560 error_ = port_->GetError(); |
| 1558 sent_packets_discarded_++; | 1561 sent_packets_discarded_++; |
| 1559 } else { | 1562 } else { |
| 1560 send_rate_tracker_.Update(sent); | 1563 send_rate_tracker_.Update(sent); |
| 1561 } | 1564 } |
| 1562 return sent; | 1565 return sent; |
| 1563 } | 1566 } |
| 1564 | 1567 |
| 1565 } // namespace cricket | 1568 } // namespace cricket |
| OLD | NEW |