Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/zeroconf/_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from ._updates import RecordUpdate, RecordUpdateListener
from ._utils.time import current_time_millis, millis_to_seconds
from .const import (
_ADDRESS_RECORD_TYPES,
_CLASS_IN,
_CLASS_UNIQUE,
_DNS_OTHER_TTL,
Expand All @@ -71,7 +72,6 @@
_AnswerWithAdditionalsType = Dict[DNSRecord, Set[DNSRecord]]

_MULTICAST_DELAY_RANDOM_INTERVAL = (20, 120)
_ADDRESS_RECORD_TYPES = {_TYPE_A, _TYPE_AAAA}
_RESPOND_IMMEDIATE_TYPES = {_TYPE_NSEC, _TYPE_SRV, *_ADDRESS_RECORD_TYPES}


Expand Down
5 changes: 2 additions & 3 deletions src/zeroconf/_services/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from .._utils.name import cached_possible_types, service_type_name
from .._utils.time import current_time_millis, millis_to_seconds
from ..const import (
_ADDRESS_RECORD_TYPES,
_BROWSER_BACKOFF_LIMIT,
_BROWSER_TIME,
_CLASS_IN,
Expand All @@ -63,8 +64,6 @@
_MDNS_ADDR,
_MDNS_ADDR6,
_MDNS_PORT,
_TYPE_A,
_TYPE_AAAA,
_TYPE_PTR,
)

Expand Down Expand Up @@ -386,7 +385,7 @@ def _async_process_record_update(
if old_record or record.is_expired(now):
return

if record_type in (_TYPE_A, _TYPE_AAAA):
if record_type in _ADDRESS_RECORD_TYPES:
# Iterate through the DNSCache and callback any services that use this address
for type_, name in self._names_matching_types(
{service.name for service in self.zc.cache.async_entries_with_server(record.name)}
Expand Down
2 changes: 2 additions & 0 deletions src/zeroconf/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@
_TYPE_NSEC: "nsec",
}

_ADDRESS_RECORD_TYPES = {_TYPE_A, _TYPE_AAAA}

_HAS_A_TO_Z = re.compile(r'[A-Za-z]')
_HAS_ONLY_A_TO_Z_NUM_HYPHEN = re.compile(r'^[A-Za-z0-9\-]+$')
_HAS_ONLY_A_TO_Z_NUM_HYPHEN_UNDERSCORE = re.compile(r'^[A-Za-z0-9\-\_]+$')
Expand Down