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 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 int64_t time_received = rtc::TimeMillis(); | 1404 int64_t time_received = rtc::TimeMillis(); |
1405 packet_loss_estimator_.ReceivedResponse(request->id(), time_received); | 1405 packet_loss_estimator_.ReceivedResponse(request->id(), time_received); |
1406 | 1406 |
1407 stats_.recv_ping_responses++; | 1407 stats_.recv_ping_responses++; |
1408 | 1408 |
1409 MaybeUpdateLocalCandidate(request, response); | 1409 MaybeUpdateLocalCandidate(request, response); |
1410 } | 1410 } |
1411 | 1411 |
1412 void Connection::OnConnectionRequestErrorResponse(ConnectionRequest* request, | 1412 void Connection::OnConnectionRequestErrorResponse(ConnectionRequest* request, |
1413 StunMessage* response) { | 1413 StunMessage* response) { |
1414 const StunErrorCodeAttribute* error_attr = response->GetErrorCode(); | 1414 int error_code = response->GetErrorCodeValue(); |
1415 int error_code = STUN_ERROR_GLOBAL_FAILURE; | |
1416 if (error_attr) { | |
1417 error_code = error_attr->code(); | |
1418 } | |
1419 | |
1420 LOG_J(LS_INFO, this) << "Received STUN error response" | 1415 LOG_J(LS_INFO, this) << "Received STUN error response" |
1421 << " id=" << rtc::hex_encode(request->id()) | 1416 << " id=" << rtc::hex_encode(request->id()) |
1422 << " code=" << error_code | 1417 << " code=" << error_code |
1423 << " rtt=" << request->Elapsed(); | 1418 << " rtt=" << request->Elapsed(); |
1424 | 1419 |
1425 if (error_code == STUN_ERROR_UNKNOWN_ATTRIBUTE || | 1420 if (error_code == STUN_ERROR_UNKNOWN_ATTRIBUTE || |
1426 error_code == STUN_ERROR_SERVER_ERROR || | 1421 error_code == STUN_ERROR_SERVER_ERROR || |
1427 error_code == STUN_ERROR_UNAUTHORIZED) { | 1422 error_code == STUN_ERROR_UNAUTHORIZED) { |
1428 // Recoverable error, retry | 1423 // Recoverable error, retry |
1429 } else if (error_code == STUN_ERROR_STALE_CREDENTIALS) { | 1424 } else if (error_code == STUN_ERROR_STALE_CREDENTIALS) { |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1625 RTC_DCHECK(sent < 0); | 1620 RTC_DCHECK(sent < 0); |
1626 error_ = port_->GetError(); | 1621 error_ = port_->GetError(); |
1627 stats_.sent_discarded_packets++; | 1622 stats_.sent_discarded_packets++; |
1628 } else { | 1623 } else { |
1629 send_rate_tracker_.AddSamples(sent); | 1624 send_rate_tracker_.AddSamples(sent); |
1630 } | 1625 } |
1631 return sent; | 1626 return sent; |
1632 } | 1627 } |
1633 | 1628 |
1634 } // namespace cricket | 1629 } // namespace cricket |
OLD | NEW |