Skip to content
Snippets Groups Projects
Commit 665016cc authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

don't overwrite stanza ID in zeroconf so that we reply with correct ID to requests. Thanks Mattj

parent fdcf75ae
No related branches found
No related tags found
No related merge requests found
......@@ -689,8 +689,9 @@ class ClientZeroconf:
# look for hashed connections
if to in self.recipient_to_hash:
conn = self.connections[self.recipient_to_hash[to]]
id_ = conn.Dispatcher.getAnID()
stanza.setID(id_)
if not stanza.getID():
id_ = conn.Dispatcher.getAnID()
stanza.setID(id_)
if conn.add_stanza(stanza, is_message):
if on_ok:
on_ok(id_)
......@@ -699,14 +700,16 @@ class ClientZeroconf:
hash_ = self.ip_to_hash[item['address']]
if self.hash_to_port[hash_] == item['port']:
conn = self.connections[hash_]
id_ = conn.Dispatcher.getAnID()
stanza.setID(id_)
if not stanza.getID():
id_ = conn.Dispatcher.getAnID()
stanza.setID(id_)
if conn.add_stanza(stanza, is_message):
if on_ok:
on_ok(id_)
# otherwise open new connection
stanza.setID('zero')
if not stanza.getID():
stanza.setID('zero')
P2PClient(None, item['address'], item['port'], self,
[(stanza, is_message)], to, on_ok=on_ok, on_not_ok=on_not_ok)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment