Notes on error-detection and handling in an outbound relay

This commit is contained in:
Tony Garnock-Jones 2011-12-21 16:58:42 -05:00
parent 7f44278cf6
commit b62e7d8bf4
1 changed files with 11 additions and 0 deletions

View File

@ -94,6 +94,17 @@
((request) (dns-request message host port))
((response) (bad-dns-packet message host port 'unexpected-dns-response)))))
;; TODO: dns-reply->udp-packet may fail! The server may supply some
;; value that isn't a proper DNSMessage. In that case we might like to
;; not send a UDP packet, but instead send out a bad-dns-packet local
;; message for logging etc. (Glossing over the issue of identifying
;; the direction of the message for now.)
;;
;; Once we move to pluggable external-event-sources/relays this will
;; go away: they'll be handlers like anything else, that just happen
;; to have a side effect in some containing (or if not containing, at
;; least *in-scope*) network.
(define (dns-reply->udp-packet r)
(match-define (dns-reply message host port) r)
(udp-packet (dns-message->packet message) host port))