OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 } | 428 } |
429 socket_ = NULL; | 429 socket_ = NULL; |
430 | 430 |
431 PrepareAddress(); | 431 PrepareAddress(); |
432 ++allocate_mismatch_retries_; | 432 ++allocate_mismatch_retries_; |
433 } | 433 } |
434 | 434 |
435 Connection* TurnPort::CreateConnection(const Candidate& address, | 435 Connection* TurnPort::CreateConnection(const Candidate& address, |
436 CandidateOrigin origin) { | 436 CandidateOrigin origin) { |
437 // TURN-UDP can only connect to UDP candidates. | 437 // TURN-UDP can only connect to UDP candidates. |
438 if (address.protocol() != UDP_PROTOCOL_NAME) { | 438 if (!ProtocolMatch(address.protocol())) { |
439 return NULL; | 439 return NULL; |
440 } | 440 } |
441 | 441 |
442 if (!IsCompatibleAddress(address.address())) { | 442 if (!IsCompatibleAddress(address.address())) { |
443 return NULL; | 443 return NULL; |
444 } | 444 } |
445 | 445 |
446 if (state_ == STATE_DISCONNECTED) { | 446 if (state_ == STATE_DISCONNECTED) { |
447 return NULL; | 447 return NULL; |
448 } | 448 } |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3 | 1429 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3 |
1430 if (code == STUN_ERROR_STALE_NONCE) { | 1430 if (code == STUN_ERROR_STALE_NONCE) { |
1431 if (port_->UpdateNonce(response)) { | 1431 if (port_->UpdateNonce(response)) { |
1432 // Send channel bind request with fresh nonce. | 1432 // Send channel bind request with fresh nonce. |
1433 SendChannelBindRequest(0); | 1433 SendChannelBindRequest(0); |
1434 } | 1434 } |
1435 } | 1435 } |
1436 } | 1436 } |
1437 | 1437 |
1438 } // namespace cricket | 1438 } // namespace cricket |
OLD | NEW |