Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1076 | 1076 |
| 1077 // Try to find the TurnPort that matches the remote address. Note that the | 1077 // Try to find the TurnPort that matches the remote address. Note that the |
| 1078 // message could be a STUN binding response if the TURN server is also used as | 1078 // message could be a STUN binding response if the TURN server is also used as |
| 1079 // a STUN server. We don't want to parse every message here to check if it is | 1079 // a STUN server. We don't want to parse every message here to check if it is |
| 1080 // a STUN binding response, so we pass the message to TurnPort regardless of | 1080 // a STUN binding response, so we pass the message to TurnPort regardless of |
| 1081 // the message type. The TurnPort will just ignore the message since it will | 1081 // the message type. The TurnPort will just ignore the message since it will |
| 1082 // not find any request by transaction ID. | 1082 // not find any request by transaction ID. |
| 1083 for (std::vector<TurnPort*>::const_iterator it = turn_ports_.begin(); | 1083 for (std::vector<TurnPort*>::const_iterator it = turn_ports_.begin(); |
| 1084 it != turn_ports_.end(); ++it) { | 1084 it != turn_ports_.end(); ++it) { |
| 1085 TurnPort* port = *it; | 1085 TurnPort* port = *it; |
| 1086 if (port->server_address().address == remote_addr) { | 1086 if (port->SharedSocket() && port->server_address().address == remote_addr) { |
| 1087 port->HandleIncomingPacket(socket, data, size, remote_addr, packet_time); | 1087 port->HandleIncomingPacket(socket, data, size, remote_addr, packet_time); |
| 1088 turn_port_found = true; | 1088 turn_port_found = true; |
| 1089 break; | 1089 break; |
| 1090 } | 1090 } |
| 1091 } | 1091 } |
| 1092 | 1092 |
| 1093 if (udp_port_) { | 1093 if (udp_port_) { |
| 1094 const ServerAddresses& stun_servers = udp_port_->server_addresses(); | 1094 const ServerAddresses& stun_servers = udp_port_->server_addresses(); |
| 1095 | 1095 |
| 1096 // Pass the packet to the UdpPort if there is no matching TurnPort, or if | 1096 // Pass the packet to the UdpPort if there is no matching TurnPort, or if |
| 1097 // the TURN server is also a STUN server. | 1097 // the TURN server is also a STUN server. |
| 1098 if (!turn_port_found || | 1098 if (!turn_port_found || |
| 1099 stun_servers.find(remote_addr) != stun_servers.end()) { | 1099 stun_servers.find(remote_addr) != stun_servers.end()) { |
| 1100 RTP_DCHECK(udp_port_->SharedSocket()); | |
|
Irfan
2016/04/18 21:53:12
RTC_DCHECK ?
Sergey Ulanov
2016/04/18 22:35:14
It's webrtc's version of DCHECK(). See webrtc/base
Irfan
2016/04/18 22:42:43
yes, I meant s/RTP_DCHECK/RTC_DCHECK
Sergey Ulanov
2016/04/18 23:02:44
Done.
| |
| 1100 udp_port_->HandleIncomingPacket( | 1101 udp_port_->HandleIncomingPacket( |
| 1101 socket, data, size, remote_addr, packet_time); | 1102 socket, data, size, remote_addr, packet_time); |
| 1102 } | 1103 } |
| 1103 } | 1104 } |
| 1104 } | 1105 } |
| 1105 | 1106 |
| 1106 void AllocationSequence::OnPortDestroyed(PortInterface* port) { | 1107 void AllocationSequence::OnPortDestroyed(PortInterface* port) { |
| 1107 if (udp_port_ == port) { | 1108 if (udp_port_ == port) { |
| 1108 udp_port_ = NULL; | 1109 udp_port_ = NULL; |
| 1109 return; | 1110 return; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1184 ServerAddresses servers; | 1185 ServerAddresses servers; |
| 1185 for (size_t i = 0; i < relays.size(); ++i) { | 1186 for (size_t i = 0; i < relays.size(); ++i) { |
| 1186 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { | 1187 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { |
| 1187 servers.insert(relays[i].ports.front().address); | 1188 servers.insert(relays[i].ports.front().address); |
| 1188 } | 1189 } |
| 1189 } | 1190 } |
| 1190 return servers; | 1191 return servers; |
| 1191 } | 1192 } |
| 1192 | 1193 |
| 1193 } // namespace cricket | 1194 } // namespace cricket |
| OLD | NEW |