Sending an empty packet to the proxy causes it to dump its current cache contents, for debugging
This commit is contained in:
parent
0c3ebff5f1
commit
8d715290ee
|
@ -22,6 +22,10 @@
|
|||
(os-big-bang 'no-state
|
||||
(subscribe 'packet-reader
|
||||
(meta-message-handlers w
|
||||
[(udp-packet source (== s) #"")
|
||||
(display "Debug dump packet received\n")
|
||||
(transition w
|
||||
(send-message `(debug-dump)))]
|
||||
[(udp-packet source (== s) body)
|
||||
(transition w
|
||||
(send-message
|
||||
|
|
13
proxy.rkt
13
proxy.rkt
|
@ -145,6 +145,19 @@
|
|||
;; TODO: consider deduping questions here too?
|
||||
(subscribe 'question-handler-factory
|
||||
(message-handlers zone
|
||||
[`(debug-dump)
|
||||
(with-output-to-file "zone-proxy.dump"
|
||||
(lambda ()
|
||||
(display "----------------------------------------------------------------------\n")
|
||||
(display (seconds->date (current-seconds)))
|
||||
(newline)
|
||||
(for* ([(domain rrmap) zone] [(rr expiry) rrmap])
|
||||
(write (list rr expiry))
|
||||
(newline))
|
||||
(newline))
|
||||
#:mode 'text
|
||||
#:exists 'append)
|
||||
zone]
|
||||
[(? question? q)
|
||||
(transition zone
|
||||
(spawn (question-handler zone q client-sock)))]
|
||||
|
|
Loading…
Reference in New Issue