For whatever reason, the recv() call receives less bytes if doing a send() over the localhost interface would only be able to send fewer bytes. This may be a Linux kernel bug, or some side effect of doing everything over the localhost interface.
Bottom line, I can't trigger a partial send() in Deadwood 2.3. Since I still haven't come up with a testcase to test partial sends, I can't fix the issues Deadwood 2.3 may or may not have with partial sends.
It looks like partial sends work without problem in Deadwood 2.4, since the testcases here actually triggered partial sends which I was able to test and get to work.
Since DNS-over-TCP is very very rare, this issue isn't a priority right now.
So, without further ado, here's the current Deadwood 2.4 TODO:
- Make it possible to have upstream_servers for hostnames besides the root hostname (".").
- Then I should take MaraDNS' DNS compression and decompression code and port it to Deadwood's codebase.
- Next, I can think about TTL aging and resource record rotation.
- Then I can concentrate on real recursion.