Removed fqdn? and unqualified-hostname

This commit is contained in:
mainzelm 2003-02-10 13:13:26 +00:00
parent 35efb036af
commit 0b8c33af3f
1 changed files with 19 additions and 13 deletions

View File

@ -1424,8 +1424,12 @@
(socket-address->internet-address addr)
(apply dns-lookup-ip ip32 args)))
(define (fqdn? name)
(regexp-search? (rx #\.) name))
;; Some code to test the components of domain names
;;(define label-regexp
;; (rx (: alpha (? (* (| alphanumeric "-")) alphanumeric))))
;;(define (unqualified-hostname name)
;; (regexp-search? (rx (: ,label-regexp)) name))
(define (maybe-dns-lookup-name name . args)
(call-with-current-continuation
@ -1435,7 +1439,7 @@
(k #f)
(more)))
(lambda ()
(dns-lookup-name name args))))))
(apply dns-lookup-name name args))))))
(define (maybe-dns-lookup-ip ip-addr . args)
(call-with-current-continuation
@ -1460,8 +1464,10 @@
(if (socket-address? name-or-socket-address)
(apply socket-address->fqdn name-or-socket-address args)
(let ((name name-or-socket-address))
(if (fqdn? name)
name
(cond ((apply maybe-dns-lookup-name name args)
=> (lambda (ip)
(apply dns-lookup-ip ip args)))
(else
(let lp ((domains (domains-for-search)))
(if (null? domains)
#f
@ -1469,7 +1475,7 @@
(string-append name "." (car domains)) args)
=> (lambda (ip)
(apply dns-lookup-ip ip args)))
(else (lp (cdr domains))))))))))
(else (lp (cdr domains)))))))))))
(define (system-fqdn . args)
(apply host-fqdn (system-name) args))