Remove deprecated TurnPort::Create() versions
Bug: webrtc:10335 Change-Id: I62eb0534ade2de221bc90c2f6c4f3caa0ac2e91b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256266 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36280}
This commit is contained in:
parent
493718ea47
commit
cf08d33944
@ -104,76 +104,6 @@ class TurnPort : public Port {
|
||||
args.config->tls_cert_verifier, args.field_trials));
|
||||
}
|
||||
|
||||
// Create a TURN port using the shared UDP socket, `socket`.
|
||||
// TODO(jonaso) : remove in favor or CreateRelayPortArgs version.
|
||||
static std::unique_ptr<TurnPort> Create(
|
||||
rtc::Thread* thread,
|
||||
rtc::PacketSocketFactory* factory,
|
||||
rtc::Network* network,
|
||||
rtc::AsyncPacketSocket* socket,
|
||||
const std::string& username, // ice username.
|
||||
const std::string& password, // ice password.
|
||||
const ProtocolAddress& server_address,
|
||||
const RelayCredentials& credentials,
|
||||
int server_priority,
|
||||
webrtc::TurnCustomizer* customizer,
|
||||
const webrtc::WebRtcKeyValueConfig* field_trials = nullptr) {
|
||||
// Do basic parameter validation.
|
||||
if (credentials.username.size() > kMaxTurnUsernameLength) {
|
||||
RTC_LOG(LS_ERROR) << "Attempt to use TURN with a too long username "
|
||||
<< "of length " << credentials.username.size();
|
||||
return nullptr;
|
||||
}
|
||||
// Do not connect to low-numbered ports. The default STUN port is 3478.
|
||||
if (!AllowedTurnPort(server_address.address.port(), field_trials)) {
|
||||
RTC_LOG(LS_ERROR) << "Attempt to use TURN to connect to port "
|
||||
<< server_address.address.port();
|
||||
}
|
||||
// Using `new` to access a non-public constructor.
|
||||
return absl::WrapUnique(new TurnPort(thread, factory, network, socket,
|
||||
username, password, server_address,
|
||||
credentials, server_priority, {}, {},
|
||||
customizer, nullptr, field_trials));
|
||||
}
|
||||
|
||||
// TODO(jonaso) : remove in favor or CreateRelayPortArgs version.
|
||||
// Create a TURN port that will use a new socket, bound to `network` and
|
||||
// using a port in the range between `min_port` and `max_port`.
|
||||
static std::unique_ptr<TurnPort> Create(
|
||||
rtc::Thread* thread,
|
||||
rtc::PacketSocketFactory* factory,
|
||||
rtc::Network* network,
|
||||
uint16_t min_port,
|
||||
uint16_t max_port,
|
||||
const std::string& username, // ice username.
|
||||
const std::string& password, // ice password.
|
||||
const ProtocolAddress& server_address,
|
||||
const RelayCredentials& credentials,
|
||||
int server_priority,
|
||||
const std::vector<std::string>& tls_alpn_protocols,
|
||||
const std::vector<std::string>& tls_elliptic_curves,
|
||||
webrtc::TurnCustomizer* customizer,
|
||||
rtc::SSLCertificateVerifier* tls_cert_verifier = nullptr,
|
||||
const webrtc::WebRtcKeyValueConfig* field_trials = nullptr) {
|
||||
// Do basic parameter validation.
|
||||
if (credentials.username.size() > kMaxTurnUsernameLength) {
|
||||
RTC_LOG(LS_ERROR) << "Attempt to use TURN with a too long username "
|
||||
<< "of length " << credentials.username.size();
|
||||
return nullptr;
|
||||
}
|
||||
// Do not connect to low-numbered ports. The default STUN port is 3478.
|
||||
if (!AllowedTurnPort(server_address.address.port(), field_trials)) {
|
||||
RTC_LOG(LS_ERROR) << "Attempt to use TURN to connect to port "
|
||||
<< server_address.address.port();
|
||||
return nullptr;
|
||||
}
|
||||
// Using `new` to access a non-public constructor.
|
||||
return absl::WrapUnique(new TurnPort(
|
||||
thread, factory, network, min_port, max_port, username, password,
|
||||
server_address, credentials, server_priority, tls_alpn_protocols,
|
||||
tls_elliptic_curves, customizer, tls_cert_verifier, field_trials));
|
||||
}
|
||||
|
||||
~TurnPort() override;
|
||||
|
||||
const ProtocolAddress& server_address() const { return server_address_; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user