fix pyZeroconf bug where getServiceInfo returns None. cherry-pick
authorb.taylor@willowglen.ca
Wed, 12 Aug 2009 13:40:20 -0600
branchcherry-pick
changeset 373 a7f26d9f214f
parent 357 19db1076e93c
child 374 8787fa8c6792
fix pyZeroconf bug where getServiceInfo returns None.
This allows the discovery window to work with targets using Avahi to advertise their services.
(patch obtained from <http://sourceforge.net/tracker/?func=detail&aid=1600775&group_id=100909&atid=628622>)
Zeroconf.py
--- a/Zeroconf.py	Mon Jul 06 11:27:06 2009 -0600
+++ b/Zeroconf.py	Wed Aug 12 13:40:20 2009 -0600
@@ -1154,7 +1154,7 @@
         """Updates service information from a DNS record"""
         if record is not None and not record.isExpired(now):
             if record.type == _TYPE_A:
-                if record.name == self.name:
+                if record.name == self.server:
                     self.address = record.address
             elif record.type == _TYPE_SRV:
                 if record.name == self.name:
@@ -1162,7 +1162,6 @@
                     self.port = record.port
                     self.weight = record.weight
                     self.priority = record.priority
-                    self.address = None
                     self.updateRecord(zeroconf, now, zeroconf.cache.getByDetails(self.server, _TYPE_A, _CLASS_IN))
             elif record.type == _TYPE_TXT:
                 if record.name == self.name: