Commit 125bc5b1 authored by Paul Eggert's avatar Paul Eggert

dns-query now represents SOA integers as integers (Bug#38937)

* lisp/net/dns.el (dns-read-int32): Declare obsolete.
Assume bignums.
(dns-read-type): Represent SOA integers as integers, not strings.
parent 41a270d2
Pipeline #4565 passed with stage
in 56 minutes and 30 seconds
......@@ -58,6 +58,11 @@ incorrect hashes for window configurations and some other objects.
** The obsolete function 'thread-alive-p' has been removed.
** dns-query now consistently uses Lisp integers to represent integers.
Formerly it made an exception for integer components of SOA records,
because SOA serial numbers can exceed fixnum ranges on 32-bit platforms.
Emacs now supports bignums so this old glitch is no longer needed.
* Lisp Changes in Emacs 28.1
......
......@@ -258,10 +258,8 @@ If TCP-P, the first two bytes of the package with be the length field."
(nreverse spec))))
(defun dns-read-int32 ()
;; Full 32 bit Integers can't be handled by 32-bit Emacsen. If we
;; use floats, it works.
(format "%.0f" (+ (* (dns-read-bytes 1) 16777216.0)
(dns-read-bytes 3))))
(declare (obsolete nil "28.1"))
(number-to-string (dns-read-bytes 4)))
(defun dns-read-type (string type)
(let ((buffer (current-buffer))
......@@ -286,11 +284,11 @@ If TCP-P, the first two bytes of the package with be the length field."
((eq type 'SOA)
(list (list 'mname (dns-read-name buffer))
(list 'rname (dns-read-name buffer))
(list 'serial (dns-read-int32))
(list 'refresh (dns-read-int32))
(list 'retry (dns-read-int32))
(list 'expire (dns-read-int32))
(list 'minimum (dns-read-int32))))
(list 'serial (dns-read-bytes 4))
(list 'refresh (dns-read-bytes 4))
(list 'retry (dns-read-bytes 4))
(list 'expire (dns-read-bytes 4))
(list 'minimum (dns-read-bytes 4))))
((eq type 'SRV)
(list (list 'priority (dns-read-bytes 2))
(list 'weight (dns-read-bytes 2))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment