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
6 changes: 3 additions & 3 deletions src/zeroconf/_protocol/outgoing.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ cdef class DNSOutgoing:
)
cpdef packets(self)

cpdef add_question_or_all_cache(self, DNSCache cache, object now, str name, object type_, object class_)
cpdef add_question_or_all_cache(self, DNSCache cache, double now, str name, object type_, object class_)

cpdef add_question_or_one_cache(self, DNSCache cache, object now, str name, object type_, object class_)
cpdef add_question_or_one_cache(self, DNSCache cache, double now, str name, object type_, object class_)

cpdef add_question(self, DNSQuestion question)

cpdef add_answer(self, DNSIncoming inp, DNSRecord record)

@cython.locals(now_double=double)
cpdef add_answer_at_time(self, DNSRecord record, object now)
cpdef add_answer_at_time(self, DNSRecord record, double now)

cpdef add_authorative_answer(self, DNSPointer record)

Expand Down
4 changes: 2 additions & 2 deletions src/zeroconf/_protocol/outgoing.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ def add_question(self, record: DNSQuestion) -> None:
def add_answer(self, inp: DNSIncoming, record: DNSRecord) -> None:
"""Adds an answer"""
if not record.suppressed_by(inp):
self.add_answer_at_time(record, 0)
self.add_answer_at_time(record, 0.0)

def add_answer_at_time(self, record: Optional[DNSRecord], now: Union[float, int]) -> None:
def add_answer_at_time(self, record: Optional[DNSRecord], now: float_) -> None:
"""Adds an answer if it does not expire by a certain time"""
now_double = now
if record is not None and (now_double == 0 or not record.is_expired(now_double)):
Expand Down