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

Unified Diff: jingle/notifier/listener/listen_task.cc

Issue 6392014: [Sync] Relax checks for received XMPP messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed sanjeev's comments Created 9 years, 11 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 | « chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/notifier/listener/listen_task.cc
diff --git a/jingle/notifier/listener/listen_task.cc b/jingle/notifier/listener/listen_task.cc
index 8466c5733725b10c13ab46bf1d53c8668bd42e29..01fb26cc9564f28176184c5eb8e64a0d99d2dd2b 100644
--- a/jingle/notifier/listener/listen_task.cc
+++ b/jingle/notifier/listener/listen_task.cc
@@ -65,8 +65,9 @@ int ListenTask::ProcessResponse() {
// Note that there can be multiple "Result" elements, so we need to loop
// through all of them.
bool update_signaled = false;
+ const buzz::QName kQnNotifierGetAll(kNotifierNamespace, "getAll");
const buzz::XmlElement* get_all_element =
- stanza->FirstNamed(buzz::QName("google:notifier", "getAll"));
+ stanza->FirstNamed(kQnNotifierGetAll);
if (get_all_element) {
const buzz::XmlElement* result_element =
get_all_element->FirstNamed(
@@ -125,8 +126,6 @@ bool ListenTask::HandleStanza(const buzz::XmlElement* stanza) {
}
bool ListenTask::IsValidNotification(const buzz::XmlElement* stanza) {
- static const buzz::QName kQnNotifierGetAll(
- kNotifierNamespace, "getAll");
// An update notificaiton has the following form.
// <cli:iq from="{bare_jid}" to="{full_jid}"
// id="#" type="set" xmlns:cli="jabber:client">
@@ -134,10 +133,11 @@ bool ListenTask::IsValidNotification(const buzz::XmlElement* stanza) {
// <Timestamp long="#" xmlns=""/>
// </not:getAll>
// </cli:iq>
- return
- (MatchRequestIq(stanza, buzz::STR_SET, kQnNotifierGetAll) &&
- (stanza->Attr(buzz::QN_TO) == GetClient()->jid().Str()) &&
- (stanza->Attr(buzz::QN_FROM) == GetClient()->jid().BareJid().Str()));
+ //
+ // We deliberately minimize the verification we do here, though: see
+ // http://crbug.com/71285 .
+ const buzz::QName kQnNotifierGetAll(kNotifierNamespace, "getAll");
+ return MatchRequestIq(stanza, buzz::STR_SET, kQnNotifierGetAll);
}
} // namespace notifier
« no previous file with comments | « chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698