don't overwrite stanza ID in zeroconf so that we reply with correct ID to requests. Thanks Mattj
This commit is contained in:
parent
fdcf75ae59
commit
665016ccc0
|
@ -689,8 +689,9 @@ class ClientZeroconf:
|
||||||
# look for hashed connections
|
# look for hashed connections
|
||||||
if to in self.recipient_to_hash:
|
if to in self.recipient_to_hash:
|
||||||
conn = self.connections[self.recipient_to_hash[to]]
|
conn = self.connections[self.recipient_to_hash[to]]
|
||||||
id_ = conn.Dispatcher.getAnID()
|
if not stanza.getID():
|
||||||
stanza.setID(id_)
|
id_ = conn.Dispatcher.getAnID()
|
||||||
|
stanza.setID(id_)
|
||||||
if conn.add_stanza(stanza, is_message):
|
if conn.add_stanza(stanza, is_message):
|
||||||
if on_ok:
|
if on_ok:
|
||||||
on_ok(id_)
|
on_ok(id_)
|
||||||
|
@ -699,14 +700,16 @@ class ClientZeroconf:
|
||||||
hash_ = self.ip_to_hash[item['address']]
|
hash_ = self.ip_to_hash[item['address']]
|
||||||
if self.hash_to_port[hash_] == item['port']:
|
if self.hash_to_port[hash_] == item['port']:
|
||||||
conn = self.connections[hash_]
|
conn = self.connections[hash_]
|
||||||
id_ = conn.Dispatcher.getAnID()
|
if not stanza.getID():
|
||||||
stanza.setID(id_)
|
id_ = conn.Dispatcher.getAnID()
|
||||||
|
stanza.setID(id_)
|
||||||
if conn.add_stanza(stanza, is_message):
|
if conn.add_stanza(stanza, is_message):
|
||||||
if on_ok:
|
if on_ok:
|
||||||
on_ok(id_)
|
on_ok(id_)
|
||||||
|
|
||||||
# otherwise open new connection
|
# otherwise open new connection
|
||||||
stanza.setID('zero')
|
if not stanza.getID():
|
||||||
|
stanza.setID('zero')
|
||||||
P2PClient(None, item['address'], item['port'], self,
|
P2PClient(None, item['address'], item['port'], self,
|
||||||
[(stanza, is_message)], to, on_ok=on_ok, on_not_ok=on_not_ok)
|
[(stanza, is_message)], to, on_ok=on_ok, on_not_ok=on_not_ok)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue