aboutsummaryrefslogtreecommitdiff
path: root/p2p
diff options
context:
space:
mode:
authorTommi <tommi@webrtc.org>2022-04-12 14:03:40 +0200
committerWebRTC LUCI CQ <webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-04-12 12:52:08 +0000
commit278b19da385c4226d8a9489c72fa1a897a27ee26 (patch)
treec99402ff83ef380a7c958924ab47e326613f2fa7 /p2p
parent2545257982a3c27daca1e333f8fdc2e86c486563 (diff)
downloadwebrtc-278b19da385c4226d8a9489c72fa1a897a27ee26.tar.gz
Rename variables of type StunMessage* from `request` to `message`.
This is just to reduce confusion since StunMessage and StunRequest instances are frequently used together and message objects are often configured from within request objects (which makes the name confusing). Bug: none Change-Id: I8bf5e774a5149239dd3023817614d411633bf583 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258484 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36533}
Diffstat (limited to 'p2p')
-rw-r--r--p2p/base/connection.cc66
-rw-r--r--p2p/base/connection.h6
-rw-r--r--p2p/base/port.cc22
-rw-r--r--p2p/base/port.h4
-rw-r--r--p2p/base/port_interface.h2
-rw-r--r--p2p/base/stun_port.cc4
-rw-r--r--p2p/base/stun_request.cc4
-rw-r--r--p2p/base/stun_request.h4
-rw-r--r--p2p/base/stun_request_unittest.cc4
-rw-r--r--p2p/base/stun_server.cc8
-rw-r--r--p2p/base/stun_server.h2
-rw-r--r--p2p/base/turn_port.cc54
12 files changed, 90 insertions, 90 deletions
diff --git a/p2p/base/connection.cc b/p2p/base/connection.cc
index 38a186da98..67e1a5ea29 100644
--- a/p2p/base/connection.cc
+++ b/p2p/base/connection.cc
@@ -168,54 +168,54 @@ ConnectionRequest::ConnectionRequest(StunRequestManager& manager,
: StunRequest(manager, std::make_unique<IceMessage>()),
connection_(connection) {}
-void ConnectionRequest::Prepare(StunMessage* request) {
+void ConnectionRequest::Prepare(StunMessage* message) {
RTC_DCHECK_RUN_ON(connection_->network_thread_);
- request->SetType(STUN_BINDING_REQUEST);
+ message->SetType(STUN_BINDING_REQUEST);
std::string username;
connection_->port()->CreateStunUsername(
connection_->remote_candidate().username(), &username);
// Note that the order of attributes does not impact the parsing on the
// receiver side. The attribute is retrieved then by iterating and matching
// over all parsed attributes. See StunMessage::GetAttribute.
- request->AddAttribute(
+ message->AddAttribute(
std::make_unique<StunByteStringAttribute>(STUN_ATTR_USERNAME, username));
// connection_ already holds this ping, so subtract one from count.
if (connection_->port()->send_retransmit_count_attribute()) {
- request->AddAttribute(std::make_unique<StunUInt32Attribute>(
+ message->AddAttribute(std::make_unique<StunUInt32Attribute>(
STUN_ATTR_RETRANSMIT_COUNT,
static_cast<uint32_t>(connection_->pings_since_last_response_.size() -
1)));
}
uint32_t network_info = connection_->port()->Network()->id();
network_info = (network_info << 16) | connection_->port()->network_cost();
- request->AddAttribute(std::make_unique<StunUInt32Attribute>(
+ message->AddAttribute(std::make_unique<StunUInt32Attribute>(
STUN_ATTR_GOOG_NETWORK_INFO, network_info));
if (connection_->field_trials_->piggyback_ice_check_acknowledgement &&
connection_->last_ping_id_received()) {
- request->AddAttribute(std::make_unique<StunByteStringAttribute>(
+ message->AddAttribute(std::make_unique<StunByteStringAttribute>(
STUN_ATTR_GOOG_LAST_ICE_CHECK_RECEIVED,
connection_->last_ping_id_received().value()));
}
// Adding ICE_CONTROLLED or ICE_CONTROLLING attribute based on the role.
if (connection_->port()->GetIceRole() == ICEROLE_CONTROLLING) {
- request->AddAttribute(std::make_unique<StunUInt64Attribute>(
+ message->AddAttribute(std::make_unique<StunUInt64Attribute>(
STUN_ATTR_ICE_CONTROLLING, connection_->port()->IceTiebreaker()));
// We should have either USE_CANDIDATE attribute or ICE_NOMINATION
// attribute but not both. That was enforced in p2ptransportchannel.
if (connection_->use_candidate_attr()) {
- request->AddAttribute(
+ message->AddAttribute(
std::make_unique<StunByteStringAttribute>(STUN_ATTR_USE_CANDIDATE));
}
if (connection_->nomination_ &&
connection_->nomination_ != connection_->acked_nomination()) {
- request->AddAttribute(std::make_unique<StunUInt32Attribute>(
+ message->AddAttribute(std::make_unique<StunUInt32Attribute>(
STUN_ATTR_NOMINATION, connection_->nomination_));
}
} else if (connection_->port()->GetIceRole() == ICEROLE_CONTROLLED) {
- request->AddAttribute(std::make_unique<StunUInt64Attribute>(
+ message->AddAttribute(std::make_unique<StunUInt64Attribute>(
STUN_ATTR_ICE_CONTROLLED, connection_->port()->IceTiebreaker()));
} else {
RTC_DCHECK_NOTREACHED();
@@ -234,7 +234,7 @@ void ConnectionRequest::Prepare(StunMessage* request) {
uint32_t prflx_priority =
type_preference << 24 |
(connection_->local_candidate().priority() & 0x00FFFFFF);
- request->AddAttribute(std::make_unique<StunUInt32Attribute>(
+ message->AddAttribute(std::make_unique<StunUInt32Attribute>(
STUN_ATTR_PRIORITY, prflx_priority));
if (connection_->field_trials_->enable_goog_ping &&
@@ -245,16 +245,16 @@ void ConnectionRequest::Prepare(StunMessage* request) {
auto list =
StunAttribute::CreateUInt16ListAttribute(STUN_ATTR_GOOG_MISC_INFO);
list->AddTypeAtIndex(kSupportGoogPingVersionRequestIndex, kGoogPingVersion);
- request->AddAttribute(std::move(list));
+ message->AddAttribute(std::move(list));
}
- if (connection_->ShouldSendGoogPing(request)) {
- request->SetType(GOOG_PING_REQUEST);
- request->ClearAttributes();
- request->AddMessageIntegrity32(connection_->remote_candidate().password());
+ if (connection_->ShouldSendGoogPing(message)) {
+ message->SetType(GOOG_PING_REQUEST);
+ message->ClearAttributes();
+ message->AddMessageIntegrity32(connection_->remote_candidate().password());
} else {
- request->AddMessageIntegrity(connection_->remote_candidate().password());
- request->AddFingerprint();
+ message->AddMessageIntegrity(connection_->remote_candidate().password());
+ message->AddFingerprint();
}
}
@@ -576,7 +576,7 @@ void Connection::OnReadPacket(const char* data,
if (msg->IntegrityOk()) {
requests_.CheckResponse(msg.get());
}
- // Otherwise silently discard the response message.
+ // Otherwise silently discard the response.
break;
// Remote end point sent an STUN indication instead of regular binding
@@ -699,25 +699,25 @@ void Connection::HandleStunBindingOrGoogPingRequest(IceMessage* msg) {
}
}
-void Connection::SendStunBindingResponse(const StunMessage* request) {
+void Connection::SendStunBindingResponse(const StunMessage* message) {
RTC_DCHECK_RUN_ON(network_thread_);
- RTC_DCHECK(request->type() == STUN_BINDING_REQUEST);
+ RTC_DCHECK_EQ(message->type(), STUN_BINDING_REQUEST);
- // Retrieve the username from the request.
+ // Retrieve the username from the `message`.
const StunByteStringAttribute* username_attr =
- request->GetByteString(STUN_ATTR_USERNAME);
+ message->GetByteString(STUN_ATTR_USERNAME);
RTC_DCHECK(username_attr != NULL);
if (username_attr == NULL) {
// No valid username, skip the response.
return;
}
- // Fill in the response message.
+ // Fill in the response.
StunMessage response;
response.SetType(STUN_BINDING_RESPONSE);
- response.SetTransactionID(request->transaction_id());
+ response.SetTransactionID(message->transaction_id());
const StunUInt32Attribute* retransmit_attr =
- request->GetUInt32(STUN_ATTR_RETRANSMIT_COUNT);
+ message->GetUInt32(STUN_ATTR_RETRANSMIT_COUNT);
if (retransmit_attr) {
// Inherit the incoming retransmit value in the response so the other side
// can see our view of lost pings.
@@ -736,8 +736,8 @@ void Connection::SendStunBindingResponse(const StunMessage* request) {
STUN_ATTR_XOR_MAPPED_ADDRESS, remote_candidate_.address()));
if (field_trials_->announce_goog_ping) {
- // Check if request contains a announce-request.
- auto goog_misc = request->GetUInt16List(STUN_ATTR_GOOG_MISC_INFO);
+ // Check if message contains a announce-request.
+ auto goog_misc = message->GetUInt16List(STUN_ATTR_GOOG_MISC_INFO);
if (goog_misc != nullptr &&
goog_misc->Size() >= kSupportGoogPingVersionRequestIndex &&
// Which version can we handle...currently any >= 1
@@ -756,14 +756,14 @@ void Connection::SendStunBindingResponse(const StunMessage* request) {
SendResponseMessage(response);
}
-void Connection::SendGoogPingResponse(const StunMessage* request) {
+void Connection::SendGoogPingResponse(const StunMessage* message) {
RTC_DCHECK_RUN_ON(network_thread_);
- RTC_DCHECK(request->type() == GOOG_PING_REQUEST);
+ RTC_DCHECK(message->type() == GOOG_PING_REQUEST);
- // Fill in the response message.
+ // Fill in the response.
StunMessage response;
response.SetType(GOOG_PING_RESPONSE);
- response.SetTransactionID(request->transaction_id());
+ response.SetTransactionID(message->transaction_id());
response.AddMessageIntegrity32(local_candidate().password());
SendResponseMessage(response);
}
@@ -773,7 +773,7 @@ void Connection::SendResponseMessage(const StunMessage& response) {
// Where I send the response.
const rtc::SocketAddress& addr = remote_candidate_.address();
- // Send the response message.
+ // Send the response.
rtc::ByteBufferWriter buf;
response.Write(&buf);
rtc::PacketOptions options(port_->StunDscpValue());
diff --git a/p2p/base/connection.h b/p2p/base/connection.h
index d871bc4ceb..c60616069d 100644
--- a/p2p/base/connection.h
+++ b/p2p/base/connection.h
@@ -58,7 +58,7 @@ struct CandidatePair final : public CandidatePairInterface {
class ConnectionRequest : public StunRequest {
public:
ConnectionRequest(StunRequestManager& manager, Connection* connection);
- void Prepare(StunMessage* request) override;
+ void Prepare(StunMessage* message) override;
void OnResponse(StunMessage* response) override;
void OnErrorResponse(StunMessage* response) override;
void OnTimeout() override;
@@ -306,8 +306,8 @@ class Connection : public CandidatePairInterface, public sigslot::has_slots<> {
// Does not trigger SignalStateChange
void ForgetLearnedState();
- void SendStunBindingResponse(const StunMessage* request);
- void SendGoogPingResponse(const StunMessage* request);
+ void SendStunBindingResponse(const StunMessage* message);
+ void SendGoogPingResponse(const StunMessage* message);
void SendResponseMessage(const StunMessage& response);
// An accessor for unit tests.
diff --git a/p2p/base/port.cc b/p2p/base/port.cc
index 74db59de9d..4a7daaffec 100644
--- a/p2p/base/port.cc
+++ b/p2p/base/port.cc
@@ -739,21 +739,21 @@ bool Port::CanHandleIncomingPacketsFrom(const rtc::SocketAddress&) const {
return false;
}
-void Port::SendBindingErrorResponse(StunMessage* request,
+void Port::SendBindingErrorResponse(StunMessage* message,
const rtc::SocketAddress& addr,
int error_code,
const std::string& reason) {
- RTC_DCHECK(request->type() == STUN_BINDING_REQUEST ||
- request->type() == GOOG_PING_REQUEST);
+ RTC_DCHECK(message->type() == STUN_BINDING_REQUEST ||
+ message->type() == GOOG_PING_REQUEST);
// Fill in the response message.
StunMessage response;
- if (request->type() == STUN_BINDING_REQUEST) {
+ if (message->type() == STUN_BINDING_REQUEST) {
response.SetType(STUN_BINDING_ERROR_RESPONSE);
} else {
response.SetType(GOOG_PING_ERROR_RESPONSE);
}
- response.SetTransactionID(request->transaction_id());
+ response.SetTransactionID(message->transaction_id());
// When doing GICE, we need to write out the error code incorrectly to
// maintain backwards compatiblility.
@@ -766,15 +766,15 @@ void Port::SendBindingErrorResponse(StunMessage* request,
// because we don't have enough information to determine the shared secret.
if (error_code != STUN_ERROR_BAD_REQUEST &&
error_code != STUN_ERROR_UNAUTHORIZED &&
- request->type() != GOOG_PING_REQUEST) {
- if (request->type() == STUN_BINDING_REQUEST) {
+ message->type() != GOOG_PING_REQUEST) {
+ if (message->type() == STUN_BINDING_REQUEST) {
response.AddMessageIntegrity(password_);
} else {
response.AddMessageIntegrity32(password_);
}
}
- if (request->type() == STUN_BINDING_REQUEST) {
+ if (message->type() == STUN_BINDING_REQUEST) {
response.AddFingerprint();
}
@@ -792,15 +792,15 @@ void Port::SendBindingErrorResponse(StunMessage* request,
}
void Port::SendUnknownAttributesErrorResponse(
- StunMessage* request,
+ StunMessage* message,
const rtc::SocketAddress& addr,
const std::vector<uint16_t>& unknown_types) {
- RTC_DCHECK(request->type() == STUN_BINDING_REQUEST);
+ RTC_DCHECK(message->type() == STUN_BINDING_REQUEST);
// Fill in the response message.
StunMessage response;
response.SetType(STUN_BINDING_ERROR_RESPONSE);
- response.SetTransactionID(request->transaction_id());
+ response.SetTransactionID(message->transaction_id());
auto error_attr = StunAttribute::CreateErrorCode();
error_attr->SetCode(STUN_ERROR_UNKNOWN_ATTRIBUTE);
diff --git a/p2p/base/port.h b/p2p/base/port.h
index 56f551d7be..b2aa9b243f 100644
--- a/p2p/base/port.h
+++ b/p2p/base/port.h
@@ -312,12 +312,12 @@ class Port : public PortInterface,
const rtc::SocketAddress& remote_addr) const;
// Sends a response error to the given request.
- void SendBindingErrorResponse(StunMessage* request,
+ void SendBindingErrorResponse(StunMessage* message,
const rtc::SocketAddress& addr,
int error_code,
const std::string& reason) override;
void SendUnknownAttributesErrorResponse(
- StunMessage* request,
+ StunMessage* message,
const rtc::SocketAddress& addr,
const std::vector<uint16_t>& unknown_types);
diff --git a/p2p/base/port_interface.h b/p2p/base/port_interface.h
index 02fd97993a..babe27d85d 100644
--- a/p2p/base/port_interface.h
+++ b/p2p/base/port_interface.h
@@ -107,7 +107,7 @@ class PortInterface {
// Sends a response message (normal or error) to the given request. One of
// these methods should be called as a response to SignalUnknownAddress.
- virtual void SendBindingErrorResponse(StunMessage* request,
+ virtual void SendBindingErrorResponse(StunMessage* message,
const rtc::SocketAddress& addr,
int error_code,
const std::string& reason) = 0;
diff --git a/p2p/base/stun_port.cc b/p2p/base/stun_port.cc
index 5d7c426d45..6d16b9cf33 100644
--- a/p2p/base/stun_port.cc
+++ b/p2p/base/stun_port.cc
@@ -47,8 +47,8 @@ class StunBindingRequest : public StunRequest {
const rtc::SocketAddress& server_addr() const { return server_addr_; }
- void Prepare(StunMessage* request) override {
- request->SetType(STUN_BINDING_REQUEST);
+ void Prepare(StunMessage* message) override {
+ message->SetType(STUN_BINDING_REQUEST);
}
void OnResponse(StunMessage* response) override {
diff --git a/p2p/base/stun_request.cc b/p2p/base/stun_request.cc
index 0131779755..eebdd07716 100644
--- a/p2p/base/stun_request.cc
+++ b/p2p/base/stun_request.cc
@@ -191,9 +191,9 @@ StunRequest::StunRequest(StunRequestManager& manager)
}
StunRequest::StunRequest(StunRequestManager& manager,
- std::unique_ptr<StunMessage> request)
+ std::unique_ptr<StunMessage> message)
: manager_(manager),
- msg_(std::move(request)),
+ msg_(std::move(message)),
tstamp_(0),
count_(0),
timeout_(false) {
diff --git a/p2p/base/stun_request.h b/p2p/base/stun_request.h
index e75804d4b9..f4d6b2b0a8 100644
--- a/p2p/base/stun_request.h
+++ b/p2p/base/stun_request.h
@@ -86,7 +86,7 @@ class StunRequest : public rtc::MessageHandler {
public:
explicit StunRequest(StunRequestManager& manager);
StunRequest(StunRequestManager& manager,
- std::unique_ptr<StunMessage> request);
+ std::unique_ptr<StunMessage> message);
~StunRequest() override;
// Causes our wrapped StunMessage to be Prepared
@@ -117,7 +117,7 @@ class StunRequest : public rtc::MessageHandler {
// Fills in a request object to be sent. Note that request's transaction ID
// will already be set and cannot be changed.
- virtual void Prepare(StunMessage* request) {}
+ virtual void Prepare(StunMessage* message) {}
// Called when the message receives a response or times out.
virtual void OnResponse(StunMessage* response) {}
diff --git a/p2p/base/stun_request_unittest.cc b/p2p/base/stun_request_unittest.cc
index b551c342c1..125bb47963 100644
--- a/p2p/base/stun_request_unittest.cc
+++ b/p2p/base/stun_request_unittest.cc
@@ -99,8 +99,8 @@ class StunRequestThunker : public StunRequest {
}
virtual void OnTimeout() { test_->OnTimeout(); }
- virtual void Prepare(StunMessage* request) {
- request->SetType(STUN_BINDING_REQUEST);
+ virtual void Prepare(StunMessage* message) {
+ message->SetType(STUN_BINDING_REQUEST);
}
StunRequestTest* test_;
diff --git a/p2p/base/stun_server.cc b/p2p/base/stun_server.cc
index 382b787951..25f0634b05 100644
--- a/p2p/base/stun_server.cc
+++ b/p2p/base/stun_server.cc
@@ -83,15 +83,15 @@ void StunServer::SendResponse(const StunMessage& msg,
RTC_LOG_ERR(LS_ERROR) << "sendto";
}
-void StunServer::GetStunBindResponse(StunMessage* request,
+void StunServer::GetStunBindResponse(StunMessage* message,
const rtc::SocketAddress& remote_addr,
StunMessage* response) const {
response->SetType(STUN_BINDING_RESPONSE);
- response->SetTransactionID(request->transaction_id());
+ response->SetTransactionID(message->transaction_id());
- // Tell the user the address that we received their request from.
+ // Tell the user the address that we received their message from.
std::unique_ptr<StunAddressAttribute> mapped_addr;
- if (request->IsLegacy()) {
+ if (message->IsLegacy()) {
mapped_addr = StunAttribute::CreateAddress(STUN_ATTR_MAPPED_ADDRESS);
} else {
mapped_addr = StunAttribute::CreateXorAddress(STUN_ATTR_XOR_MAPPED_ADDRESS);
diff --git a/p2p/base/stun_server.h b/p2p/base/stun_server.h
index f2126db191..54d8d9083c 100644
--- a/p2p/base/stun_server.h
+++ b/p2p/base/stun_server.h
@@ -58,7 +58,7 @@ class StunServer : public sigslot::has_slots<> {
void SendResponse(const StunMessage& msg, const rtc::SocketAddress& addr);
// A helper method to compose a STUN binding response.
- void GetStunBindResponse(StunMessage* request,
+ void GetStunBindResponse(StunMessage* message,
const rtc::SocketAddress& remote_addr,
StunMessage* response) const;
diff --git a/p2p/base/turn_port.cc b/p2p/base/turn_port.cc
index 8729a8277e..e15f35211b 100644
--- a/p2p/base/turn_port.cc
+++ b/p2p/base/turn_port.cc
@@ -73,7 +73,7 @@ static int GetRelayPreference(cricket::ProtocolType proto) {
class TurnAllocateRequest : public StunRequest {
public:
explicit TurnAllocateRequest(TurnPort* port);
- void Prepare(StunMessage* request) override;
+ void Prepare(StunMessage* message) override;
void OnSent() override;
void OnResponse(StunMessage* response) override;
void OnErrorResponse(StunMessage* response) override;
@@ -91,7 +91,7 @@ class TurnAllocateRequest : public StunRequest {
class TurnRefreshRequest : public StunRequest {
public:
explicit TurnRefreshRequest(TurnPort* port);
- void Prepare(StunMessage* request) override;
+ void Prepare(StunMessage* message) override;
void OnSent() override;
void OnResponse(StunMessage* response) override;
void OnErrorResponse(StunMessage* response) override;
@@ -110,7 +110,7 @@ class TurnCreatePermissionRequest : public StunRequest,
TurnEntry* entry,
const rtc::SocketAddress& ext_addr,
const std::string& remote_ufrag);
- void Prepare(StunMessage* request) override;
+ void Prepare(StunMessage* message) override;
void OnSent() override;
void OnResponse(StunMessage* response) override;
void OnErrorResponse(StunMessage* response) override;
@@ -131,7 +131,7 @@ class TurnChannelBindRequest : public StunRequest, public sigslot::has_slots<> {
TurnEntry* entry,
int channel_id,
const rtc::SocketAddress& ext_addr);
- void Prepare(StunMessage* request) override;
+ void Prepare(StunMessage* message) override;
void OnSent() override;
void OnResponse(StunMessage* response) override;
void OnErrorResponse(StunMessage* response) override;
@@ -1364,18 +1364,18 @@ TurnAllocateRequest::TurnAllocateRequest(TurnPort* port)
: StunRequest(port->request_manager(), std::make_unique<TurnMessage>()),
port_(port) {}
-void TurnAllocateRequest::Prepare(StunMessage* request) {
+void TurnAllocateRequest::Prepare(StunMessage* message) {
// Create the request as indicated in RFC 5766, Section 6.1.
- request->SetType(TURN_ALLOCATE_REQUEST);
+ message->SetType(TURN_ALLOCATE_REQUEST);
auto transport_attr =
StunAttribute::CreateUInt32(STUN_ATTR_REQUESTED_TRANSPORT);
transport_attr->SetValue(IPPROTO_UDP << 24);
- request->AddAttribute(std::move(transport_attr));
+ message->AddAttribute(std::move(transport_attr));
if (!port_->hash().empty()) {
- port_->AddRequestAuthInfo(request);
+ port_->AddRequestAuthInfo(message);
}
- port_->MaybeAddTurnLoggingId(request);
- port_->TurnCustomizerMaybeModifyOutgoingStunMessage(request);
+ port_->MaybeAddTurnLoggingId(message);
+ port_->TurnCustomizerMaybeModifyOutgoingStunMessage(message);
}
void TurnAllocateRequest::OnSent() {
@@ -1554,17 +1554,17 @@ TurnRefreshRequest::TurnRefreshRequest(TurnPort* port)
port_(port),
lifetime_(-1) {}
-void TurnRefreshRequest::Prepare(StunMessage* request) {
+void TurnRefreshRequest::Prepare(StunMessage* message) {
// Create the request as indicated in RFC 5766, Section 7.1.
// No attributes need to be included.
- request->SetType(TURN_REFRESH_REQUEST);
+ message->SetType(TURN_REFRESH_REQUEST);
if (lifetime_ > -1) {
- request->AddAttribute(
+ message->AddAttribute(
std::make_unique<StunUInt32Attribute>(STUN_ATTR_LIFETIME, lifetime_));
}
- port_->AddRequestAuthInfo(request);
- port_->TurnCustomizerMaybeModifyOutgoingStunMessage(request);
+ port_->AddRequestAuthInfo(message);
+ port_->TurnCustomizerMaybeModifyOutgoingStunMessage(message);
}
void TurnRefreshRequest::OnSent() {
@@ -1642,18 +1642,18 @@ TurnCreatePermissionRequest::TurnCreatePermissionRequest(
this, &TurnCreatePermissionRequest::OnEntryDestroyed);
}
-void TurnCreatePermissionRequest::Prepare(StunMessage* request) {
+void TurnCreatePermissionRequest::Prepare(StunMessage* message) {
// Create the request as indicated in RFC5766, Section 9.1.
- request->SetType(TURN_CREATE_PERMISSION_REQUEST);
- request->AddAttribute(std::make_unique<StunXorAddressAttribute>(
+ message->SetType(TURN_CREATE_PERMISSION_REQUEST);
+ message->AddAttribute(std::make_unique<StunXorAddressAttribute>(
STUN_ATTR_XOR_PEER_ADDRESS, ext_addr_));
if (port_->field_trials_ &&
port_->field_trials_->IsEnabled("WebRTC-TurnAddMultiMapping")) {
- request->AddAttribute(std::make_unique<cricket::StunByteStringAttribute>(
+ message->AddAttribute(std::make_unique<cricket::StunByteStringAttribute>(
STUN_ATTR_MULTI_MAPPING, remote_ufrag_));
}
- port_->AddRequestAuthInfo(request);
- port_->TurnCustomizerMaybeModifyOutgoingStunMessage(request);
+ port_->AddRequestAuthInfo(message);
+ port_->TurnCustomizerMaybeModifyOutgoingStunMessage(message);
}
void TurnCreatePermissionRequest::OnSent() {
@@ -1715,15 +1715,15 @@ TurnChannelBindRequest::TurnChannelBindRequest(
&TurnChannelBindRequest::OnEntryDestroyed);
}
-void TurnChannelBindRequest::Prepare(StunMessage* request) {
+void TurnChannelBindRequest::Prepare(StunMessage* message) {
// Create the request as indicated in RFC5766, Section 11.1.
- request->SetType(TURN_CHANNEL_BIND_REQUEST);
- request->AddAttribute(std::make_unique<StunUInt32Attribute>(
+ message->SetType(TURN_CHANNEL_BIND_REQUEST);
+ message->AddAttribute(std::make_unique<StunUInt32Attribute>(
STUN_ATTR_CHANNEL_NUMBER, channel_id_ << 16));
- request->AddAttribute(std::make_unique<StunXorAddressAttribute>(
+ message->AddAttribute(std::make_unique<StunXorAddressAttribute>(
STUN_ATTR_XOR_PEER_ADDRESS, ext_addr_));
- port_->AddRequestAuthInfo(request);
- port_->TurnCustomizerMaybeModifyOutgoingStunMessage(request);
+ port_->AddRequestAuthInfo(message);
+ port_->TurnCustomizerMaybeModifyOutgoingStunMessage(message);
}
void TurnChannelBindRequest::OnSent() {