| 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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 size_t index, | 778 size_t index, |
| 779 const Candidate& remote_candidate) | 779 const Candidate& remote_candidate) |
| 780 : port_(port), | 780 : port_(port), |
| 781 local_candidate_index_(index), | 781 local_candidate_index_(index), |
| 782 remote_candidate_(remote_candidate), | 782 remote_candidate_(remote_candidate), |
| 783 read_state_(STATE_READ_INIT), | 783 read_state_(STATE_READ_INIT), |
| 784 write_state_(STATE_WRITE_INIT), | 784 write_state_(STATE_WRITE_INIT), |
| 785 connected_(true), | 785 connected_(true), |
| 786 pruned_(false), | 786 pruned_(false), |
| 787 use_candidate_attr_(false), | 787 use_candidate_attr_(false), |
| 788 nominated_(false), |
| 788 remote_ice_mode_(ICEMODE_FULL), | 789 remote_ice_mode_(ICEMODE_FULL), |
| 789 requests_(port->thread()), | 790 requests_(port->thread()), |
| 790 rtt_(DEFAULT_RTT), | 791 rtt_(DEFAULT_RTT), |
| 791 last_ping_sent_(0), | 792 last_ping_sent_(0), |
| 792 last_ping_received_(0), | 793 last_ping_received_(0), |
| 793 last_data_received_(0), | 794 last_data_received_(0), |
| 794 last_ping_response_received_(0), | 795 last_ping_response_received_(0), |
| 795 sent_packets_discarded_(0), | 796 sent_packets_discarded_(0), |
| 796 sent_packets_total_(0), | 797 sent_packets_total_(0), |
| 797 reported_(false), | 798 reported_(false), |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 // This call will also set the connection readable. | 946 // This call will also set the connection readable. |
| 946 port_->SendBindingResponse(msg.get(), addr); | 947 port_->SendBindingResponse(msg.get(), addr); |
| 947 | 948 |
| 948 // If timed out sending writability checks, start up again | 949 // If timed out sending writability checks, start up again |
| 949 if (!pruned_ && (write_state_ == STATE_WRITE_TIMEOUT)) | 950 if (!pruned_ && (write_state_ == STATE_WRITE_TIMEOUT)) |
| 950 set_write_state(STATE_WRITE_INIT); | 951 set_write_state(STATE_WRITE_INIT); |
| 951 | 952 |
| 952 if (port_->GetIceRole() == ICEROLE_CONTROLLED) { | 953 if (port_->GetIceRole() == ICEROLE_CONTROLLED) { |
| 953 const StunByteStringAttribute* use_candidate_attr = | 954 const StunByteStringAttribute* use_candidate_attr = |
| 954 msg->GetByteString(STUN_ATTR_USE_CANDIDATE); | 955 msg->GetByteString(STUN_ATTR_USE_CANDIDATE); |
| 955 if (use_candidate_attr) | 956 if (use_candidate_attr) { |
| 956 SignalUseCandidate(this); | 957 set_nominated(true); |
| 958 SignalNominated(this); |
| 959 } |
| 957 } | 960 } |
| 958 } else { | 961 } else { |
| 959 // The packet had the right local username, but the remote username | 962 // The packet had the right local username, but the remote username |
| 960 // was not the right one for the remote address. | 963 // was not the right one for the remote address. |
| 961 LOG_J(LS_ERROR, this) | 964 LOG_J(LS_ERROR, this) |
| 962 << "Received STUN request with bad remote username " | 965 << "Received STUN request with bad remote username " |
| 963 << remote_ufrag; | 966 << remote_ufrag; |
| 964 port_->SendBindingErrorResponse(msg.get(), addr, | 967 port_->SendBindingErrorResponse(msg.get(), addr, |
| 965 STUN_ERROR_UNAUTHORIZED, | 968 STUN_ERROR_UNAUTHORIZED, |
| 966 STUN_ERROR_REASON_UNAUTHORIZED); | 969 STUN_ERROR_REASON_UNAUTHORIZED); |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 ASSERT(sent < 0); | 1421 ASSERT(sent < 0); |
| 1419 error_ = port_->GetError(); | 1422 error_ = port_->GetError(); |
| 1420 sent_packets_discarded_++; | 1423 sent_packets_discarded_++; |
| 1421 } else { | 1424 } else { |
| 1422 send_rate_tracker_.Update(sent); | 1425 send_rate_tracker_.Update(sent); |
| 1423 } | 1426 } |
| 1424 return sent; | 1427 return sent; |
| 1425 } | 1428 } |
| 1426 | 1429 |
| 1427 } // namespace cricket | 1430 } // namespace cricket |
| OLD | NEW |