diff options
-rw-r--r-- | guix/avahi.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/guix/avahi.scm b/guix/avahi.scm index 132e42f268..cb0c85f9f4 100644 --- a/guix/avahi.scm +++ b/guix/avahi.scm @@ -137,7 +137,15 @@ when STOP-LOOP? procedure returns true." (port port) (txt txt)))) (hash-set! %known-hosts service-name service*) - (proc 'new-service service*))))) + (proc 'new-service service*)))) + ((eq? event resolver-event/failure) + ;; Failure to resolve the host associated with a service. This + ;; usually means that the mDNS record hasn't expired yet but that + ;; the host went off-line. + (let ((service (hash-ref %known-hosts service-name))) + (when service + (proc 'remove-service service) + (hash-remove! %known-hosts service-name))))) (free-service-resolver! resolver)) (define (service-browser-callback browser interface protocol event |