Notes on error-detection and handling in an outbound relay
This commit is contained in:
parent
7f44278cf6
commit
b62e7d8bf4
|
@ -94,6 +94,17 @@
|
||||||
((request) (dns-request message host port))
|
((request) (dns-request message host port))
|
||||||
((response) (bad-dns-packet message host port 'unexpected-dns-response)))))
|
((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)
|
(define (dns-reply->udp-packet r)
|
||||||
(match-define (dns-reply message host port) r)
|
(match-define (dns-reply message host port) r)
|
||||||
(udp-packet (dns-message->packet message) host port))
|
(udp-packet (dns-message->packet message) host port))
|
||||||
|
|
Loading…
Reference in New Issue