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

Unified Diff: webrtc/p2p/client/basicportallocator.cc

Issue 1871693004: Fix AllocationSequence to handle the case when TurnPort stops using shared socket. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/turnport_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/client/basicportallocator.cc
diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc
index 22abf33e93639d90b276ca9d6c5cc025fca3a6e0..edfd0219d05126f9a252224e4948e9a9294eaee1 100644
--- a/webrtc/p2p/client/basicportallocator.cc
+++ b/webrtc/p2p/client/basicportallocator.cc
@@ -1080,13 +1080,13 @@ void AllocationSequence::OnReadPacket(
// a STUN binding response, so we pass the message to TurnPort regardless of
// the message type. The TurnPort will just ignore the message since it will
// not find any request by transaction ID.
- for (std::vector<TurnPort*>::const_iterator it = turn_ports_.begin();
- it != turn_ports_.end(); ++it) {
- TurnPort* port = *it;
+ for (TurnPort* port : turn_ports_) {
if (port->server_address().address == remote_addr) {
- port->HandleIncomingPacket(socket, data, size, remote_addr, packet_time);
+ if (port->HandleIncomingPacket(socket, data, size, remote_addr,
+ packet_time)) {
+ return;
+ }
turn_port_found = true;
- break;
}
}
@@ -1097,8 +1097,9 @@ void AllocationSequence::OnReadPacket(
// the TURN server is also a STUN server.
if (!turn_port_found ||
stun_servers.find(remote_addr) != stun_servers.end()) {
- udp_port_->HandleIncomingPacket(
- socket, data, size, remote_addr, packet_time);
+ RTC_DCHECK(udp_port_->SharedSocket());
+ udp_port_->HandleIncomingPacket(socket, data, size, remote_addr,
+ packet_time);
}
}
}
« no previous file with comments | « webrtc/p2p/base/turnport_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698