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

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

Issue 1649493006: Stop processing any incoming packets when turn port is disconnected. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 10 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
« 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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 << server_address_.address.ToString(); 548 << server_address_.address.ToString();
549 return; 549 return;
550 } 550 }
551 551
552 // The message must be at least the size of a channel header. 552 // The message must be at least the size of a channel header.
553 if (size < TURN_CHANNEL_HEADER_SIZE) { 553 if (size < TURN_CHANNEL_HEADER_SIZE) {
554 LOG_J(LS_WARNING, this) << "Received TURN message that was too short"; 554 LOG_J(LS_WARNING, this) << "Received TURN message that was too short";
555 return; 555 return;
556 } 556 }
557 557
558 if (state_ == STATE_DISCONNECTED) {
559 LOG_J(LS_WARNING, this)
560 << "Received TURN message while the Turn port is disconnected";
561 return;
562 }
563
558 // Check the message type, to see if is a Channel Data message. 564 // Check the message type, to see if is a Channel Data message.
559 // The message will either be channel data, a TURN data indication, or 565 // The message will either be channel data, a TURN data indication, or
560 // a response to a previous request. 566 // a response to a previous request.
561 uint16_t msg_type = rtc::GetBE16(data); 567 uint16_t msg_type = rtc::GetBE16(data);
562 if (IsTurnChannelData(msg_type)) { 568 if (IsTurnChannelData(msg_type)) {
563 HandleChannelData(msg_type, data, size, packet_time); 569 HandleChannelData(msg_type, data, size, packet_time);
564 } else if (msg_type == TURN_DATA_INDICATION) { 570 } else if (msg_type == TURN_DATA_INDICATION) {
565 HandleDataIndication(data, size, packet_time); 571 HandleDataIndication(data, size, packet_time);
566 } else { 572 } else {
567 if (SharedSocket() && 573 if (SharedSocket() &&
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 } else { 1506 } else {
1501 state_ = STATE_UNBOUND; 1507 state_ = STATE_UNBOUND;
1502 port_->DestroyConnection(ext_addr_); 1508 port_->DestroyConnection(ext_addr_);
1503 } 1509 }
1504 } 1510 }
1505 void TurnEntry::OnChannelBindTimeout() { 1511 void TurnEntry::OnChannelBindTimeout() {
1506 state_ = STATE_UNBOUND; 1512 state_ = STATE_UNBOUND;
1507 port_->DestroyConnection(ext_addr_); 1513 port_->DestroyConnection(ext_addr_);
1508 } 1514 }
1509 } // namespace cricket 1515 } // 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