From b62e7d8bf4ef51b7d816089c949342e9b161443f Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 21 Dec 2011 16:58:42 -0500 Subject: [PATCH] Notes on error-detection and handling in an outbound relay --- simplified-driver.rkt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/simplified-driver.rkt b/simplified-driver.rkt index 684c951..d754c0b 100644 --- a/simplified-driver.rkt +++ b/simplified-driver.rkt @@ -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))