@@ -96,7 +96,7 @@ def _process_outgoing_packet(out):
9696 query .add_question (r .DNSQuestion (info .name , const ._TYPE_SRV , const ._CLASS_IN ))
9797 query .add_question (r .DNSQuestion (info .name , const ._TYPE_TXT , const ._CLASS_IN ))
9898 query .add_question (r .DNSQuestion (info .server , const ._TYPE_A , const ._CLASS_IN ))
99- multicast_out = zc .query_handler .response (
99+ multicast_out = zc .query_handler .async_response (
100100 [r .DNSIncoming (packet ) for packet in query .packets ()], None , const ._MDNS_PORT
101101 )[1 ]
102102 _process_outgoing_packet (multicast_out )
@@ -134,7 +134,7 @@ def _process_outgoing_packet(out):
134134 query .add_question (r .DNSQuestion (info .name , const ._TYPE_TXT , const ._CLASS_IN ))
135135 query .add_question (r .DNSQuestion (info .server , const ._TYPE_A , const ._CLASS_IN ))
136136 _process_outgoing_packet (
137- zc .query_handler .response (
137+ zc .query_handler .async_response (
138138 [r .DNSIncoming (packet ) for packet in query .packets ()], None , const ._MDNS_PORT
139139 )[1 ]
140140 )
@@ -232,7 +232,7 @@ def test_ptr_optimization():
232232 # Verify we won't respond for 1s with the same multicast
233233 query = r .DNSOutgoing (const ._FLAGS_QR_QUERY )
234234 query .add_question (r .DNSQuestion (info .type , const ._TYPE_PTR , const ._CLASS_IN ))
235- unicast_out , multicast_out = zc .query_handler .response (
235+ unicast_out , multicast_out = zc .query_handler .async_response (
236236 [r .DNSIncoming (packet ) for packet in query .packets ()], None , const ._MDNS_PORT
237237 )
238238 assert unicast_out is None
@@ -244,7 +244,7 @@ def test_ptr_optimization():
244244 # Verify we will now respond
245245 query = r .DNSOutgoing (const ._FLAGS_QR_QUERY )
246246 query .add_question (r .DNSQuestion (info .type , const ._TYPE_PTR , const ._CLASS_IN ))
247- unicast_out , multicast_out = zc .query_handler .response (
247+ unicast_out , multicast_out = zc .query_handler .async_response (
248248 [r .DNSIncoming (packet ) for packet in query .packets ()], None , const ._MDNS_PORT
249249 )
250250 assert multicast_out .id == query .id
@@ -287,7 +287,7 @@ def test_any_query_for_ptr():
287287 question = r .DNSQuestion (type_ , const ._TYPE_ANY , const ._CLASS_IN )
288288 generated .add_question (question )
289289 packets = generated .packets ()
290- _ , multicast_out = zc .query_handler .response (
290+ _ , multicast_out = zc .query_handler .async_response (
291291 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
292292 )
293293 assert multicast_out .answers [0 ][0 ].name == type_
@@ -313,7 +313,7 @@ def test_aaaa_query():
313313 question = r .DNSQuestion (server_name , const ._TYPE_AAAA , const ._CLASS_IN )
314314 generated .add_question (question )
315315 packets = generated .packets ()
316- _ , multicast_out = zc .query_handler .response (
316+ _ , multicast_out = zc .query_handler .async_response (
317317 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
318318 )
319319 assert multicast_out .answers [0 ][0 ].address == ipv6_address
@@ -342,7 +342,7 @@ def test_unicast_response():
342342 # query
343343 query = r .DNSOutgoing (const ._FLAGS_QR_QUERY )
344344 query .add_question (r .DNSQuestion (info .type , const ._TYPE_PTR , const ._CLASS_IN ))
345- unicast_out , multicast_out = zc .query_handler .response (
345+ unicast_out , multicast_out = zc .query_handler .async_response (
346346 [r .DNSIncoming (packet ) for packet in query .packets ()], "1.2.3.4" , 1234
347347 )
348348 for out in (unicast_out , multicast_out ):
@@ -419,7 +419,7 @@ def _validate_complete_response(query, out):
419419 assert question .unicast is True
420420 query .add_question (question )
421421
422- unicast_out , multicast_out = zc .query_handler .response (
422+ unicast_out , multicast_out = zc .query_handler .async_response (
423423 [r .DNSIncoming (packet ) for packet in query .packets ()], "1.2.3.4" , const ._MDNS_PORT
424424 )
425425 assert multicast_out is None
@@ -432,7 +432,7 @@ def _validate_complete_response(query, out):
432432 question .unicast = True # Set the QU bit
433433 assert question .unicast is True
434434 query .add_question (question )
435- unicast_out , multicast_out = zc .query_handler .response (
435+ unicast_out , multicast_out = zc .query_handler .async_response (
436436 [r .DNSIncoming (packet ) for packet in query .packets ()], "1.2.3.4" , const ._MDNS_PORT
437437 )
438438 assert unicast_out is None
@@ -445,7 +445,7 @@ def _validate_complete_response(query, out):
445445 assert question .unicast is True
446446 query .add_question (question )
447447 query .add_authorative_answer (info2 .dns_pointer ())
448- unicast_out , multicast_out = zc .query_handler .response (
448+ unicast_out , multicast_out = zc .query_handler .async_response (
449449 [r .DNSIncoming (packet ) for packet in query .packets ()], "1.2.3.4" , const ._MDNS_PORT
450450 )
451451 _validate_complete_response (query , unicast_out )
@@ -458,7 +458,7 @@ def _validate_complete_response(query, out):
458458 question .unicast = True # Set the QU bit
459459 assert question .unicast is True
460460 query .add_question (question )
461- unicast_out , multicast_out = zc .query_handler .response (
461+ unicast_out , multicast_out = zc .query_handler .async_response (
462462 [r .DNSIncoming (packet ) for packet in query .packets ()], "1.2.3.4" , const ._MDNS_PORT
463463 )
464464 assert multicast_out is None
@@ -487,7 +487,7 @@ def test_known_answer_supression():
487487 question = r .DNSQuestion (type_ , const ._TYPE_PTR , const ._CLASS_IN )
488488 generated .add_question (question )
489489 packets = generated .packets ()
490- unicast_out , multicast_out = zc .query_handler .response (
490+ unicast_out , multicast_out = zc .query_handler .async_response (
491491 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
492492 )
493493 assert unicast_out is None
@@ -498,7 +498,7 @@ def test_known_answer_supression():
498498 generated .add_question (question )
499499 generated .add_answer_at_time (info .dns_pointer (), now )
500500 packets = generated .packets ()
501- unicast_out , multicast_out = zc .query_handler .response (
501+ unicast_out , multicast_out = zc .query_handler .async_response (
502502 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
503503 )
504504 assert unicast_out is None
@@ -510,7 +510,7 @@ def test_known_answer_supression():
510510 question = r .DNSQuestion (server_name , const ._TYPE_A , const ._CLASS_IN )
511511 generated .add_question (question )
512512 packets = generated .packets ()
513- unicast_out , multicast_out = zc .query_handler .response (
513+ unicast_out , multicast_out = zc .query_handler .async_response (
514514 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
515515 )
516516 assert unicast_out is None
@@ -522,7 +522,7 @@ def test_known_answer_supression():
522522 for dns_address in info .dns_addresses ():
523523 generated .add_answer_at_time (dns_address , now )
524524 packets = generated .packets ()
525- unicast_out , multicast_out = zc .query_handler .response (
525+ unicast_out , multicast_out = zc .query_handler .async_response (
526526 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
527527 )
528528 assert unicast_out is None
@@ -533,7 +533,7 @@ def test_known_answer_supression():
533533 question = r .DNSQuestion (registration_name , const ._TYPE_SRV , const ._CLASS_IN )
534534 generated .add_question (question )
535535 packets = generated .packets ()
536- unicast_out , multicast_out = zc .query_handler .response (
536+ unicast_out , multicast_out = zc .query_handler .async_response (
537537 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
538538 )
539539 assert unicast_out is None
@@ -544,7 +544,7 @@ def test_known_answer_supression():
544544 generated .add_question (question )
545545 generated .add_answer_at_time (info .dns_service (), now )
546546 packets = generated .packets ()
547- unicast_out , multicast_out = zc .query_handler .response (
547+ unicast_out , multicast_out = zc .query_handler .async_response (
548548 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
549549 )
550550 assert unicast_out is None
@@ -556,7 +556,7 @@ def test_known_answer_supression():
556556 question = r .DNSQuestion (registration_name , const ._TYPE_TXT , const ._CLASS_IN )
557557 generated .add_question (question )
558558 packets = generated .packets ()
559- unicast_out , multicast_out = zc .query_handler .response (
559+ unicast_out , multicast_out = zc .query_handler .async_response (
560560 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
561561 )
562562 assert unicast_out is None
@@ -567,7 +567,7 @@ def test_known_answer_supression():
567567 generated .add_question (question )
568568 generated .add_answer_at_time (info .dns_text (), now )
569569 packets = generated .packets ()
570- unicast_out , multicast_out = zc .query_handler .response (
570+ unicast_out , multicast_out = zc .query_handler .async_response (
571571 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
572572 )
573573 assert unicast_out is None
@@ -620,7 +620,7 @@ def test_multi_packet_known_answer_supression():
620620 generated .add_answer_at_time (info3 .dns_pointer (), now )
621621 packets = generated .packets ()
622622 assert len (packets ) > 1
623- unicast_out , multicast_out = zc .query_handler .response (
623+ unicast_out , multicast_out = zc .query_handler .async_response (
624624 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
625625 )
626626 assert unicast_out is None
@@ -661,7 +661,7 @@ def test_known_answer_supression_service_type_enumeration_query():
661661 question = r .DNSQuestion (const ._SERVICE_TYPE_ENUMERATION_NAME , const ._TYPE_PTR , const ._CLASS_IN )
662662 generated .add_question (question )
663663 packets = generated .packets ()
664- unicast_out , multicast_out = zc .query_handler .response (
664+ unicast_out , multicast_out = zc .query_handler .async_response (
665665 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
666666 )
667667 assert unicast_out is None
@@ -691,7 +691,7 @@ def test_known_answer_supression_service_type_enumeration_query():
691691 now ,
692692 )
693693 packets = generated .packets ()
694- unicast_out , multicast_out = zc .query_handler .response (
694+ unicast_out , multicast_out = zc .query_handler .async_response (
695695 [r .DNSIncoming (packet ) for packet in packets ], "1.2.3.4" , const ._MDNS_PORT
696696 )
697697 assert unicast_out is None
@@ -747,7 +747,7 @@ def test_qu_response_only_sends_additionals_if_sends_answer():
747747 assert question .unicast is True
748748 query .add_question (question )
749749
750- unicast_out , multicast_out = zc .query_handler .response (
750+ unicast_out , multicast_out = zc .query_handler .async_response (
751751 [r .DNSIncoming (packet ) for packet in query .packets ()], "1.2.3.4" , const ._MDNS_PORT
752752 )
753753 assert multicast_out is None
@@ -767,7 +767,7 @@ def test_qu_response_only_sends_additionals_if_sends_answer():
767767 assert question .unicast is True
768768 query .add_question (question )
769769
770- unicast_out , multicast_out = zc .query_handler .response (
770+ unicast_out , multicast_out = zc .query_handler .async_response (
771771 [r .DNSIncoming (packet ) for packet in query .packets ()], "1.2.3.4" , const ._MDNS_PORT
772772 )
773773 assert multicast_out is None
@@ -787,7 +787,7 @@ def test_qu_response_only_sends_additionals_if_sends_answer():
787787 assert question .unicast is True
788788 query .add_question (question )
789789
790- unicast_out , multicast_out = zc .query_handler .response (
790+ unicast_out , multicast_out = zc .query_handler .async_response (
791791 [r .DNSIncoming (packet ) for packet in query .packets ()], "1.2.3.4" , const ._MDNS_PORT
792792 )
793793 assert multicast_out .answers [0 ][0 ] == ptr_record
@@ -813,7 +813,7 @@ def test_qu_response_only_sends_additionals_if_sends_answer():
813813 query .add_question (question )
814814 zc .cache .add (info2 .dns_pointer ()) # Add 100% TTL for info2 to the cache
815815
816- unicast_out , multicast_out = zc .query_handler .response (
816+ unicast_out , multicast_out = zc .query_handler .async_response (
817817 [r .DNSIncoming (packet ) for packet in query .packets ()], "1.2.3.4" , const ._MDNS_PORT
818818 )
819819 assert multicast_out .answers [0 ][0 ] == info .dns_pointer ()
0 commit comments