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

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

Issue 1415313004: Destroy a Connection if a CreatePermission request fails. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding comment. Created 5 years, 2 months 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
« webrtc/p2p/base/turnport.cc ('K') | « webrtc/p2p/base/turnserver.h ('k') | no next file » | 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 void TurnServerAllocation::HandleCreatePermissionRequest( 691 void TurnServerAllocation::HandleCreatePermissionRequest(
692 const TurnMessage* msg) { 692 const TurnMessage* msg) {
693 // Check mandatory attributes. 693 // Check mandatory attributes.
694 const StunAddressAttribute* peer_attr = 694 const StunAddressAttribute* peer_attr =
695 msg->GetAddress(STUN_ATTR_XOR_PEER_ADDRESS); 695 msg->GetAddress(STUN_ATTR_XOR_PEER_ADDRESS);
696 if (!peer_attr) { 696 if (!peer_attr) {
697 SendBadRequestResponse(msg); 697 SendBadRequestResponse(msg);
698 return; 698 return;
699 } 699 }
700 700
701 if (server_->reject_private_addresses_ &&
702 rtc::IPIsPrivate(peer_attr->GetAddress().ipaddr())) {
703 SendErrorResponse(msg, STUN_ERROR_FORBIDDEN, STUN_ERROR_REASON_FORBIDDEN);
704 return;
705 }
706
701 // Add this permission. 707 // Add this permission.
702 AddPermission(peer_attr->GetAddress().ipaddr()); 708 AddPermission(peer_attr->GetAddress().ipaddr());
703 709
704 LOG_J(LS_INFO, this) << "Created permission, peer=" 710 LOG_J(LS_INFO, this) << "Created permission, peer="
705 << peer_attr->GetAddress(); 711 << peer_attr->GetAddress();
706 712
707 // Send a success response. 713 // Send a success response.
708 TurnMessage response; 714 TurnMessage response;
709 InitResponse(msg, &response); 715 InitResponse(msg, &response);
710 SendResponse(&response); 716 SendResponse(&response);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 thread_->PostDelayed(kChannelTimeout, this, MSG_ALLOCATION_TIMEOUT); 942 thread_->PostDelayed(kChannelTimeout, this, MSG_ALLOCATION_TIMEOUT);
937 } 943 }
938 944
939 void TurnServerAllocation::Channel::OnMessage(rtc::Message* msg) { 945 void TurnServerAllocation::Channel::OnMessage(rtc::Message* msg) {
940 ASSERT(msg->message_id == MSG_ALLOCATION_TIMEOUT); 946 ASSERT(msg->message_id == MSG_ALLOCATION_TIMEOUT);
941 SignalDestroyed(this); 947 SignalDestroyed(this);
942 delete this; 948 delete this;
943 } 949 }
944 950
945 } // namespace cricket 951 } // namespace cricket
OLDNEW
« webrtc/p2p/base/turnport.cc ('K') | « webrtc/p2p/base/turnserver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698