2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-08-21 10:40:28 +00:00

Background redfish check on snoop

When snooping, if a redfish device comes along, background the
query so that it is unable to block the main SSDP receive routine.
This commit is contained in:
Jarrod Johnson
2022-03-24 17:18:05 -04:00
parent 21bfc29a89
commit e4e15d87a7

View File

@@ -108,12 +108,15 @@ def _process_snoop(peer, rsp, mac, known_peers, newmacs, peerbymacaddress, byeha
if not value.endswith('/DeviceDescription.json'):
return
if handler:
retdata = check_fish(('/DeviceDescription.json', peerdata))
if retdata:
known_peers.add(peer)
newmacs.add(mac)
peerbymacaddress[mac] = retdata
machandlers[mac] = handler
eventlet.spawn_n(check_fish_handler, handler, peerdata, known_peers, newmacs, peerbymacaddress, machandlers, mac)
def check_fish_handler(handler, peerdata, known_peers, newmacs, peerbymacaddress, machandlers, mac):
retdata = check_fish(('/DeviceDescription.json', peerdata))
if retdata:
known_peers.add(peer)
newmacs.add(mac)
peerbymacaddress[mac] = retdata
machandlers[mac] = handler
def snoop(handler, byehandler=None, protocol=None, uuidlookup=None):