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
1 change: 1 addition & 0 deletions build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def build(setup_kwargs: Any) -> None:
"src/zeroconf/_listener.py",
"src/zeroconf/_protocol/incoming.py",
"src/zeroconf/_protocol/outgoing.py",
"src/zeroconf/_handlers/record_manager.py",
Comment thread
bdraco marked this conversation as resolved.
"src/zeroconf/_services/registry.py",
],
compiler_directives={"language_level": "3"}, # Python 3
Expand Down
23 changes: 23 additions & 0 deletions src/zeroconf/_handlers/record_manager.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

import cython

from .._cache cimport DNSCache
from .._dns cimport DNSRecord
from .._protocol.incoming cimport DNSIncoming


cdef cython.float _DNS_PTR_MIN_TTL
cdef object _ADDRESS_RECORD_TYPES
cdef object RecordUpdate

cdef class RecordManager:

cdef object zc
cdef DNSCache cache
cdef cython.list listeners

@cython.locals(
cache=DNSCache,
record=DNSRecord
)
cpdef async_updates_from_response(self, DNSIncoming msg)
4 changes: 2 additions & 2 deletions src/zeroconf/_handlers/record_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
USA
"""

import itertools
from typing import TYPE_CHECKING, List, Optional, Set, Tuple, Union, cast

from .._cache import _UniqueRecordsType
Expand Down Expand Up @@ -146,7 +145,8 @@ def async_updates_from_response(self, msg: DNSIncoming) -> None:
# processsed.
new = False
if other_adds or address_adds:
new = cache.async_add_records(itertools.chain(address_adds, other_adds))
new = cache.async_add_records(address_adds)
new |= cache.async_add_records(other_adds)
# Removes are processed last since
# ServiceInfo could generate an un-needed query
# because the data was not yet populated.
Expand Down