From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/31725 Path: main.gmane.org!not-for-mail From: Rod Whitby Newsgroups: gmane.emacs.gnus.general Subject: Re: nntp telnet connection with remote command echoes Date: 11 Jul 2000 09:52:34 +0930 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035168102 15713 80.91.224.250 (21 Oct 2002 02:41:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:41:42 +0000 (UTC) Return-Path: Original-Received: from fisher.math.uh.edu (fisher.math.uh.edu [129.7.128.35]) by mailhost.sclp.com (Postfix) with ESMTP id 113CCD051E for ; Mon, 10 Jul 2000 20:47:53 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by fisher.math.uh.edu (8.9.1/8.9.1) with ESMTP id TAC29901; Mon, 10 Jul 2000 19:44:25 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 10 Jul 2000 19:43:26 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id TAA11485 for ; Mon, 10 Jul 2000 19:43:14 -0500 (CDT) Original-Received: from ftpbox.mot.com (ftpbox.mot.com [129.188.136.101]) by mailhost.sclp.com (Postfix) with ESMTP id 0E290D051E for ; Mon, 10 Jul 2000 20:43:49 -0400 (EDT) Original-Received: [from pobox2.mot.com (pobox2.mot.com [136.182.15.8]) by ftpbox.mot.com (ftpbox 2.1) with ESMTP id RAA02994 for ; Mon, 10 Jul 2000 17:43:47 -0700 (MST)] Original-Received: [from fraser.asc.corp.mot.com (fraser.asc.corp.mot.com [217.1.104.8]) by pobox2.mot.com (MOT-pobox2 2.0) with ESMTP id RAA28645 for ; Mon, 10 Jul 2000 17:43:44 -0700 (MST)] Original-Received: from a11375-rw.asc.corp.mot.com.asc.corp.mot.com (a11375-rw [217.1.106.149]) by fraser.asc.corp.mot.com (8.8.7/8.8.7) with SMTP id KAA16072 for ; Tue, 11 Jul 2000 10:13:40 +0930 (CST) Original-To: ding@gnus.org In-Reply-To: Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "Mon, 10 Jul 2000 13:49:42 +0200" User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.2 (Molpe) Original-Lines: 142 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:31725 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:31725 Kai writes: > What you're suggesting sounds good. Just make it configurable, and > you should be all set. If it was configurable via a server parameter, > that would be even greater. That's what I've done - I've added a 'nntp-telnet-remote-echoes' variable that can be set in the select method or server parameters). It defaults to nil, which should leave the operation unchanged. Here's the diff against the CVS snapshot of nntp.el - how do I get this tested by others, and eventually included in the distribution ? *** /cygdrive/c/TEMP/T0001040 Tue Jul 11 09:48:05 2000 --- nntp.el Mon Jul 10 15:12:09 2000 *************** *** 112,117 **** --- 112,120 ---- (defvoo nntp-telnet-switches '("-8") "Switches given to the telnet command.") + (defvoo nntp-telnet-remote-echoes nil + "If non-nil, commands echoed by the remote server will be stripped.") + (defvoo nntp-end-of-line "\r\n" "String to use on the end of lines when talking to the NNTP server. This is \"\\r\\n\" by default, but should be \"\\n\" when *************** *** 257,266 **** (set-buffer (process-buffer process)) (goto-char (point-min)) (while (and (or (not (memq (char-after (point)) '(?2 ?3 ?4 ?5))) ! (looking-at "480")) (memq (process-status process) '(open run))) ! (when (looking-at "480") (nntp-handle-authinfo process)) (nntp-accept-process-output process) (goto-char (point-min))) (prog1 --- 260,276 ---- (set-buffer (process-buffer process)) (goto-char (point-min)) (while (and (or (not (memq (char-after (point)) '(?2 ?3 ?4 ?5))) ! (looking-at "480") ! (and nntp-telnet-remote-echoes nntp-last-command ! (looking-at nntp-last-command))) (memq (process-status process) '(open run))) ! (cond ! ((looking-at "480") (nntp-handle-authinfo process)) + ((and nntp-telnet-remote-echoes nntp-last-command + (looking-at nntp-last-command)) + (delete-region (point) (progn (forward-line 1) (point)))) + ) (nntp-accept-process-output process) (goto-char (point-min))) (prog1 *************** *** 419,424 **** --- 429,438 ---- (if (search-forward "\n" nil t) t nil)) + ;; An echoed command. + ((and nntp-telnet-remote-echoes nntp-last-command + (looking-at nntp-last-command)) + (delete-region (point) (progn (forward-line 1) (point)))) ;; No result here. (t nil))) *************** *** 542,547 **** --- 556,565 ---- ;; Now all replies are received. We remove CRs. (set-buffer buf) (goto-char (point-min)) + ;; Remove an echoed command. + (when (and nntp-telnet-remote-echoes nntp-last-command + (looking-at nntp-last-command)) + (delete-region (point) (progn (forward-line 1) (point)))) (while (search-forward "\r" nil t) (replace-match "" t t)) *************** *** 979,992 **** (when nntp-process-callback ;; do we have an error message? (goto-char nntp-process-start-point) ! (if (memq (following-char) '(?4 ?5)) ! ;; wants credentials? ! (if (looking-at "480") ! (nntp-handle-authinfo nntp-process-to-buffer) ! ;; report error message. ! (nntp-snarf-error-message) ! (nntp-do-callback nil)) ;; got what we expect? (goto-char (point-max)) (when (re-search-backward --- 997,1017 ---- (when nntp-process-callback ;; do we have an error message? (goto-char nntp-process-start-point) ! (cond ! ((memq (following-char) '(?4 ?5)) ! ;; wants credentials? ! (if (looking-at "480") ! (nntp-handle-authinfo nntp-process-to-buffer) ! ;; report error message. ! (nntp-snarf-error-message) ! (nntp-do-callback nil))) ! ! ;; Remove echoed command. ! ((and nntp-telnet-remote-echoes nntp-last-command ! (looking-at nntp-last-command)) ! (delete-region (point) (progn (forward-line 1) (point)))) + (t ;; got what we expect? (goto-char (point-max)) (when (re-search-backward *************** *** 1008,1014 **** ;; report it. (goto-char (point-max)) (nntp-do-callback ! (buffer-name (get-buffer nntp-process-to-buffer)))))))) (defun nntp-do-callback (arg) (let ((callback nntp-process-callback) --- 1033,1039 ---- ;; report it. (goto-char (point-max)) (nntp-do-callback ! (buffer-name (get-buffer nntp-process-to-buffer))))))))) (defun nntp-do-callback (arg) (let ((callback nntp-process-callback) -- -- Rod Whitby, Snr Staff Engr, Electronic Design Automation -- -- Motorola Australia Software Centre - Adelaide, Australia -- -- Phone: +61 8 8203 3526, Fax: +61 8 8203 3501, --