Closed ncruces closed 4 years ago
Alternatively, emulate a TCP connection (for both cache.go
and doh.go
?), which allows larger messages.
This involves not implementing net.PacketConn
, and a few protocol changes.
Also, ensure server truncated messages (TC
bit set) are not cached in cache.go
, respecting RFC 1035.
Done.
Now returning io.ErrShortBuffer
, so it doesn't go unnoticed.
But the real fix is to emulate a TCP connection.
DNS over HTTPS messages can exceed the 512 limit from RFC 1035.
Instead of simply truncating incoming data, maybe return
io.ErrShortBuffer
(as is done here).