File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747from ._updates import RecordUpdate , RecordUpdateListener
4848from ._utils .time import current_time_millis , millis_to_seconds
4949from .const import (
50+ _ADDRESS_RECORD_TYPES ,
5051 _CLASS_IN ,
5152 _CLASS_UNIQUE ,
5253 _DNS_OTHER_TTL ,
7172_AnswerWithAdditionalsType = Dict [DNSRecord , Set [DNSRecord ]]
7273
7374_MULTICAST_DELAY_RANDOM_INTERVAL = (20 , 120 )
74- _ADDRESS_RECORD_TYPES = {_TYPE_A , _TYPE_AAAA }
7575_RESPOND_IMMEDIATE_TYPES = {_TYPE_NSEC , _TYPE_SRV , * _ADDRESS_RECORD_TYPES }
7676
7777
Original file line number Diff line number Diff line change 5353from .._utils .name import cached_possible_types , service_type_name
5454from .._utils .time import current_time_millis , millis_to_seconds
5555from ..const import (
56+ _ADDRESS_RECORD_TYPES ,
5657 _BROWSER_BACKOFF_LIMIT ,
5758 _BROWSER_TIME ,
5859 _CLASS_IN ,
6364 _MDNS_ADDR ,
6465 _MDNS_ADDR6 ,
6566 _MDNS_PORT ,
66- _TYPE_A ,
67- _TYPE_AAAA ,
6867 _TYPE_PTR ,
6968)
7069
@@ -385,7 +384,7 @@ def _async_process_record_update(
385384 if old_record or record .is_expired (now ):
386385 return
387386
388- if record_type in ( _TYPE_A , _TYPE_AAAA ) :
387+ if record_type in _ADDRESS_RECORD_TYPES :
389388 # Iterate through the DNSCache and callback any services that use this address
390389 for type_ , name in self ._names_matching_types (
391390 {service .name for service in self .zc .cache .async_entries_with_server (record .name )}
Original file line number Diff line number Diff line change 139139 _TYPE_NSEC : "nsec" ,
140140}
141141
142+ _ADDRESS_RECORD_TYPES = {_TYPE_A , _TYPE_AAAA }
143+
142144_HAS_A_TO_Z = re .compile (r'[A-Za-z]' )
143145_HAS_ONLY_A_TO_Z_NUM_HYPHEN = re .compile (r'^[A-Za-z0-9\-]+$' )
144146_HAS_ONLY_A_TO_Z_NUM_HYPHEN_UNDERSCORE = re .compile (r'^[A-Za-z0-9\-\_]+$' )
You can’t perform that action at this time.
0 commit comments