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 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 } | 1340 } |
1341 | 1341 |
1342 void TurnEntry::OnCreatePermissionError(StunMessage* response, int code) { | 1342 void TurnEntry::OnCreatePermissionError(StunMessage* response, int code) { |
1343 if (code == STUN_ERROR_STALE_NONCE) { | 1343 if (code == STUN_ERROR_STALE_NONCE) { |
1344 if (port_->UpdateNonce(response)) { | 1344 if (port_->UpdateNonce(response)) { |
1345 SendCreatePermissionRequest(); | 1345 SendCreatePermissionRequest(); |
1346 } | 1346 } |
1347 } else { | 1347 } else { |
1348 // Send signal with error code. | 1348 // Send signal with error code. |
1349 port_->SignalCreatePermissionResult(port_, ext_addr_, code); | 1349 port_->SignalCreatePermissionResult(port_, ext_addr_, code); |
| 1350 Connection* c = port_->GetConnection(ext_addr_); |
| 1351 if (c) { |
| 1352 LOG_J(LS_ERROR, c) << "Received TURN CreatePermission error response, " |
| 1353 << "code=" << code << "; killing connection."; |
| 1354 c->FailAndDestroy(); |
| 1355 } |
1350 } | 1356 } |
1351 } | 1357 } |
1352 | 1358 |
1353 void TurnEntry::OnChannelBindSuccess() { | 1359 void TurnEntry::OnChannelBindSuccess() { |
1354 LOG_J(LS_INFO, port_) << "Channel bind for " << ext_addr_.ToSensitiveString() | 1360 LOG_J(LS_INFO, port_) << "Channel bind for " << ext_addr_.ToSensitiveString() |
1355 << " succeeded"; | 1361 << " succeeded"; |
1356 ASSERT(state_ == STATE_BINDING || state_ == STATE_BOUND); | 1362 ASSERT(state_ == STATE_BINDING || state_ == STATE_BOUND); |
1357 state_ = STATE_BOUND; | 1363 state_ = STATE_BOUND; |
1358 } | 1364 } |
1359 | 1365 |
1360 void TurnEntry::OnChannelBindError(StunMessage* response, int code) { | 1366 void TurnEntry::OnChannelBindError(StunMessage* response, int code) { |
1361 // TODO(mallinath) - Implement handling of error response for channel | 1367 // TODO(mallinath) - Implement handling of error response for channel |
1362 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3 | 1368 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3 |
1363 if (code == STUN_ERROR_STALE_NONCE) { | 1369 if (code == STUN_ERROR_STALE_NONCE) { |
1364 if (port_->UpdateNonce(response)) { | 1370 if (port_->UpdateNonce(response)) { |
1365 // Send channel bind request with fresh nonce. | 1371 // Send channel bind request with fresh nonce. |
1366 SendChannelBindRequest(0); | 1372 SendChannelBindRequest(0); |
1367 } | 1373 } |
1368 } | 1374 } |
1369 } | 1375 } |
1370 | 1376 |
1371 } // namespace cricket | 1377 } // namespace cricket |
OLD | NEW |