mirror of
https://github.com/NLnetLabs/domain.git
synced 2026-08-24 16:32:25 +02:00
* Add regression test for immediate EOF on stream * Fix dropped responses when DNS stream encounters EOF The `stream::Transport` loop did not account for responses that had been added to the reply channel prior to `reader_fut` returning. If a server sent a response and immediately closed the stream afterwards, that response was lost. I fixed the bug by adding an explicit check for any remaining items from `reply_receiver` in the `reader_fut` select branch. Additionally, the `Transport::error` function did not await the futures returned by `ReplySender::send`. This meant the errors were never sent and instead the channel closed without any message. I fixed that by making `Transort::error` an async fn. The PR additionally contains a regression test. Running it without the fix fails, but with the fixes it passes. I did not use stelline for this test as it requires a very specific order of IO events on the connection.