| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,7 @@ def build(setup_kwargs: Any) -> None: | |||
| 29 | 29 | "src/zeroconf/_listener.py", | |
| 30 | 30 | "src/zeroconf/_protocol/incoming.py", | |
| 31 | 31 | "src/zeroconf/_protocol/outgoing.py", | |
| 32 | + "src/zeroconf/_handlers/answers.py", | ||
| 32 | 33 | "src/zeroconf/_handlers/record_manager.py", | |
| 33 | 34 | "src/zeroconf/_handlers/query_handler.py", | |
| 34 | 35 | "src/zeroconf/_services/registry.py", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,16 @@ | |||
| 1 | + | ||
| 2 | + import cython | ||
| 3 | + | ||
| 4 | + from .._protocol.outgoing cimport DNSOutgoing | ||
| 5 | + | ||
| 6 | + | ||
| 7 | + cdef object _FLAGS_QR_RESPONSE_AA | ||
| 8 | + cdef object NAME_GETTER | ||
| 9 | + | ||
| 10 | + cpdef construct_outgoing_multicast_answers(cython.dict answers) | ||
| 11 | + | ||
| 12 | + cpdef construct_outgoing_unicast_answers( | ||
| 13 | + cython.dict answers, object ucast_source, cython.list questions, object id_ | ||
| 14 | + ) | ||
| 15 | + | ||
| 16 | + cdef _add_answers_additionals(DNSOutgoing out, cython.dict answers) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,11 +29,15 @@ | |||
| 29 | 29 | ||
| 30 | 30 | _AnswerWithAdditionalsType = Dict[DNSRecord, Set[DNSRecord]] | |
| 31 | 31 | ||
| 32 | + int_ = int | ||
| 33 | + | ||
| 32 | 34 | ||
| 33 | 35 | MULTICAST_DELAY_RANDOM_INTERVAL = (20, 120) | |
| 34 | 36 | ||
| 35 | 37 | NAME_GETTER = attrgetter('name') | |
| 36 | 38 | ||
| 39 | + _FLAGS_QR_RESPONSE_AA = _FLAGS_QR_RESPONSE | _FLAGS_AA | ||
| 40 | + | ||
| 37 | 41 | ||
| 38 | 42 | class QuestionAnswers(NamedTuple): | |
| 39 | 43 | ucast: _AnswerWithAdditionalsType | |
@@ -52,16 +56,16 @@ class AnswerGroup(NamedTuple): | |||
| 52 | 56 | ||
| 53 | 57 | def construct_outgoing_multicast_answers(answers: _AnswerWithAdditionalsType) -> DNSOutgoing: | |
| 54 | 58 | """Add answers and additionals to a DNSOutgoing.""" | |
| 55 | - out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA, multicast=True) | ||
| 59 | + out = DNSOutgoing(_FLAGS_QR_RESPONSE_AA, True) | ||
| 56 | 60 | _add_answers_additionals(out, answers) | |
| 57 | 61 | return out | |
| 58 | 62 | ||
| 59 | 63 | ||
| 60 | 64 | def construct_outgoing_unicast_answers( | |
| 61 | - answers: _AnswerWithAdditionalsType, ucast_source: bool, questions: List[DNSQuestion], id_: int | ||
| 65 | + answers: _AnswerWithAdditionalsType, ucast_source: bool, questions: List[DNSQuestion], id_: int_ | ||
| 62 | 66 | ) -> DNSOutgoing: | |
| 63 | 67 | """Add answers and additionals to a DNSOutgoing.""" | |
| 64 | - out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA, multicast=False, id_=id_) | ||
| 68 | + out = DNSOutgoing(_FLAGS_QR_RESPONSE_AA, False, id_) | ||
| 65 | 69 | # Adding the questions back when the source is legacy unicast behavior | |
| 66 | 70 | if ucast_source: | |
| 67 | 71 | for question in questions: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments