From 005dd68b4c70e428d4ee010b9d8d957818b54ba4 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 16 May 2005 22:20:39 +0000 Subject: [PATCH] Synch to No Gnus 200505162104. --- lisp/ChangeLog | 11 +++++++++++ lisp/dns.el | 12 ++++++++++++ lisp/nnheader.el | 5 ++++- lisp/nntp.el | 10 ++++++++-- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index def398f..2bfa7d1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2005-05-16 Lars Magne Ingebrigtsen + + * 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 * dgnushack.el: Autoload mail-extract-address-components for XEmacs. diff --git a/lisp/dns.el b/lisp/dns.el index 2d704fe..a243e6c 100644 --- a/lisp/dns.el +++ b/lisp/dns.el @@ -350,6 +350,18 @@ If TCP-P, the first two bytes of the package with be the length field." ;; 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. diff --git a/lisp/nnheader.el b/lisp/nnheader.el index f64f284..43c8ffb 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -592,7 +592,10 @@ given, the return value will not contain the last newline." (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) diff --git a/lisp/nntp.el b/lisp/nntp.el index e2ae447..6478bae 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -595,7 +595,12 @@ be restored and the command retried." ;; 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. @@ -657,7 +662,8 @@ command whose response triggered the error." (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))) -- 1.7.10.4