mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
The default dns.Response implementation of a dns.ResponseWriter will panic if RemoteAddr() is called after the connection to the client has been closed already. The current cache implementation doesn't create a new request+responsewriter during an asynchronous prefetch, but piggybacks on the request triggering the prefetch. This change copies the RemoteAddr first, so that it's safe to use it later during the actual prefetch request. A better implementation would be to completely decouple the prefetch request from the client triggering a request.
5.7 KiB
5.7 KiB