Handle queries indefinitely on each TCP connection

Instead of closing every incoming TCP connection after handling a single
query, continue receiving queries on each TCP connection until the
client disconnects itself.  When coupled with response dropping, this
enables silently receiving all incoming data, simulating an unresponsive
server.
This commit is contained in:
Michał Kępień
2025-03-18 16:28:18 +01:00
parent 68fe9a5df5
commit 575a874582
+1 -1
View File
@@ -542,7 +542,7 @@ class AsyncDnsServer(AsyncServer):
peer = Peer(peer_info[0], peer_info[1])
logging.debug("Accepted TCP connection from %s", peer)
for _ in range(0, 1):
while True:
try:
wire = await self._read_tcp_query(reader, peer)
if not wire: