Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Side by Side Diff: webrtc/p2p/base/turnport.cc

Issue 1415313004: Destroy a Connection if a CreatePermission request fails. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Switching to "FailAndDestroy" method on Connection. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/turnport.h ('k') | webrtc/p2p/base/turnport_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « webrtc/p2p/base/turnport.h ('k') | webrtc/p2p/base/turnport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698