+2005-05-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * nntp.el (nntp-next-result-arrived-p): Some news servers may
+ return \n.\n.\n at the end of articles. Protect against that.
+ (nntp-with-open-group): Allow debugging.
+
+ * nnheader.el (mail-header-set-extra): Make into a function
+ because I just could't understand how to quote the list properly.
+
+ * dns.el (query-dns-cached): New function.
+
2005-05-16 Katsumi Yamaoka <yamaoka@jpl.org>
* dgnushack.el: Autoload mail-extract-address-components for XEmacs.
;; connection to the DNS server.
(open-network-stream "dns" (current-buffer) server "domain")))))
+(defvar dns-cache (make-vector 4096 0))
+
+(defun query-dns-cached (name &optional type fullp reversep)
+ (let* ((key (format "%s:%s:%s:%s" name type fullp reversep))
+ (sym (intern-soft key dns-cache)))
+ (if (and sym
+ (boundp sym))
+ (symbol-value sym)
+ (let ((result (query-dns name type fullp reversep)))
+ (set (intern key dns-cache) result)
+ result))))
+
(defun query-dns (name &optional type fullp reversep)
"Query a DNS server for NAME of TYPE.
If FULLP, return the entire record returned.
(mime-find-field-decoder 'From 'nov))
(defalias 'mail-header-extra 'mime-gnus-entity-extra-internal)
-(defalias 'mail-header-set-extra 'mime-gnus-entity-set-extra-internal)
+
+(defun mail-header-set-extra (header extra)
+ "Set the extra headers in HEADER to EXTRA."
+ (mime-gnus-entity-set-extra-internal header extra))
(defun nnheader-decode-field-body (field-body field-name
&optional mode max-column)
;; a line with only a "." on it.
((eq (char-after) ?2)
(if (re-search-forward "\n\\.\r?\n" nil t)
- t
+ (progn
+ ;; Some broken news servers add another dot at the end.
+ ;; Protect against inflooping there.
+ (while (looking-at "^\\.\r?\n")
+ (forward-line 1))
+ t)
nil))
;; A result that starts with a 3xx or 4xx code is terminated
;; by a newline.
(condition-case nil
(progn ,@forms)
(quit
- (nntp-close-server)
+ (unless debug-on-quit
+ (nntp-close-server))
(signal 'quit nil))))
(when timer
(nnheader-cancel-timer timer)))