Skip to content
Merged
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
10 changes: 4 additions & 6 deletions src/zeroconf/_services/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,16 @@ def generate_service_query(
question = DNSQuestion(type_, _TYPE_PTR, _CLASS_IN)
question.unicast = qu_question
known_answers = {
cast(DNSPointer, record)
record
for record in zc.cache.get_all_by_details(type_, _TYPE_PTR, _CLASS_IN)
if not record.is_stale(now)
}
if not qu_question and zc.question_history.suppresses(
question, now, cast(Set[DNSRecord], known_answers)
):
if not qu_question and zc.question_history.suppresses(question, now, known_answers):
log.debug("Asking %s was suppressed by the question history", question)
continue
questions_with_known_answers[question] = known_answers
questions_with_known_answers[question] = cast(Set[DNSPointer], known_answers)
if not qu_question:
zc.question_history.add_question_at_time(question, now, cast(Set[DNSRecord], known_answers))
zc.question_history.add_question_at_time(question, now, known_answers)

return _group_ptr_queries_with_known_answers(now, multicast, questions_with_known_answers)

Expand Down