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

Unified Diff: remoting/protocol/jingle_messages.cc

Issue 1999443004: Clear the channel and endpoint_id in SetAddress for the XMPP channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's feedback Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_messages.cc
diff --git a/remoting/protocol/jingle_messages.cc b/remoting/protocol/jingle_messages.cc
index 57f9968e4ad3392e7a5df5445c94e5c2ddad4471..2ffa1573f3d164dccb257a4ace73f0b7c4614d05 100644
--- a/remoting/protocol/jingle_messages.cc
+++ b/remoting/protocol/jingle_messages.cc
@@ -201,12 +201,19 @@ SignalingAddress ParseAddress(
void SetAddress(buzz::XmlElement* iqElement,
const SignalingAddress& address,
bool from) {
+ // Start from a fresh slate regardless of the previous address format.
+ iqElement->ClearAttr(GetQNameByField(Field::JID, from));
+ iqElement->ClearAttr(GetQNameByField(Field::CHANNEL, from));
+ iqElement->ClearAttr(GetQNameByField(Field::ENDPOINT_ID, from));
+
if (address.empty()) {
return;
}
+ // Always set the JID.
iqElement->AddAttr(GetQNameByField(Field::JID, from), address.jid);
+ // Only set the channel and endpoint_id in the LCS channel.
if (address.channel == SignalingAddress::Channel::LCS) {
iqElement->AddAttr(GetQNameByField(Field::ENDPOINT_ID, from),
address.endpoint_id);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698