Dolda2000 GitWeb
/
lisp-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d1cf3c6
)
COMMON-NET: Made DNS resolver a bit more resilient against network errors.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 21 May 2010 00:32:47 +0000
(
02:32
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 21 May 2010 00:32:47 +0000
(
02:32
+0200)
dns.lisp
patch
|
blob
|
blame
|
history
diff --git
a/dns.lisp
b/dns.lisp
index
675bf04
..
41032da
100644
(file)
--- a/
dns.lisp
+++ b/
dns.lisp
@@
-79,7
+79,7
@@
(pos 0 :type (mod 65536))
(prev-names '() :type list))
(pos 0 :type (mod 65536))
(prev-names '() :type list))
-(define-condition dns-error (error) ())
+(define-condition dns-error (
network-
error) ())
(define-condition dns-decode-error (dns-error)
((packet :initarg :packet)))
(define-condition simple-dns-decode-error (dns-decode-error simple-error) ())
(define-condition dns-decode-error (dns-error)
((packet :initarg :packet)))
(define-condition simple-dns-decode-error (dns-decode-error simple-error) ())
@@
-292,7
+292,7
@@
(push (cons name (length packet-buf)) prev-names))
(let ((encoded (charcode:encode-string (car name) :ascii)))
(unless (< (length encoded) 64)
(push (cons name (length packet-buf)) prev-names))
(let ((encoded (charcode:encode-string (car name) :ascii)))
(unless (< (length encoded) 64)
- (
error
"DNS labels cannot exceed 63 octets in length: ~S" (car name)))
+ (
simple-dns-decode-error buf
"DNS labels cannot exceed 63 octets in length: ~S" (car name)))
(encode-uint-8 buf (length encoded))
(encode-bytes buf encoded))
(encode-label (cdr name)))))))
(encode-uint-8 buf (length encoded))
(encode-bytes buf encoded))
(encode-label (cdr name)))))))
@@
-328,7
+328,7
@@
(string (charcode:encode-string val :ascii))
((array (unsigned-byte 8)) val))))
(unless (< (length data) 256)
(string (charcode:encode-string val :ascii))
((array (unsigned-byte 8)) val))))
(unless (< (length data) 256)
- (
error
"DNS text data length cannot exceed 255 octets."))
+ (
simple-dns-decode-error buf
"DNS text data length cannot exceed 255 octets."))
(encode-uint-8 buf (length data))
(encode-bytes buf data)))
((ipv4-address)
(encode-uint-8 buf (length data))
(encode-bytes buf data)))
((ipv4-address)
@@
-680,7
+680,7
@@
(error 'dns-name-error :query-name (unparse-domain-name name) :query-type types
:config config))
(eq resp-code :success)))
(error 'dns-name-error :query-name (unparse-domain-name name) :query-type types
:config config))
(eq resp-code :success)))
- (n
ame-server-timeout
() nil))))
+ (n
etwork-error
() nil))))
(check-cache)
(signal 'dns-resolver-help :query-name (unparse-domain-name name) :query-type types
:config config)
(check-cache)
(signal 'dns-resolver-help :query-name (unparse-domain-name name) :query-type types
:config config)