From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/33970 Path: main.gmane.org!not-for-mail From: Jake Colman Newsgroups: gmane.emacs.gnus.general Subject: Re: `open-network-stream' in `nntp-open-network-stream': strange behaviour Date: 01 Jan 2001 17:11:29 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: <761yumc48e.fsf@newjersey.ppllc.com> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035169981 27951 80.91.224.250 (21 Oct 2002 03:13:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:13:01 +0000 (UTC) Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by mailhost.sclp.com (Postfix) with ESMTP id 52C04D049D for ; Mon, 1 Jan 2001 17:13:01 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id QAB18442; Mon, 1 Jan 2001 16:12:15 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 01 Jan 2001 16:11:15 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id QAA02664 for ; Mon, 1 Jan 2001 16:11:05 -0600 (CST) Original-Received: from newjersey.ppllc.com (unknown [209.208.206.221]) by mailhost.sclp.com (Postfix) with ESMTP id D0C53D049D for ; Mon, 1 Jan 2001 17:11:30 -0500 (EST) Original-Received: (from colman@localhost) by newjersey.ppllc.com (8.9.3/8.9.3) id RAA19490; Mon, 1 Jan 2001 17:11:29 -0500 (EST) X-Authentication-Warning: newjersey.ppllc.com: colman set sender to colman@ppllc.com using -f Original-To: ding@gnus.org X-Attribution: Jake X-URL: http://www.ppllc.com In-Reply-To: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Channel Islands) Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 73 Xref: main.gmane.org gmane.emacs.gnus.general:33970 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:33970 How are you using this fix? Are you replacing gnus source? I see exactly the same bug when accessing my imap server. >>>>> "CC" == Christoph Conrad writes: CC> Hi! Linux 2.2.14, i386, Emacs 20.7.1, latest CVS Oort Gnus. CC> I have the following problem since a few weeks now, a workaround i CC> found now is at the end of the mail. CC> When `open-network-stream' failed ONE time for a given host (cause i CC> am not online, host overloaded etc.), it fails forever in the same CC> emacs session. If i restart my Emacs, it works again. CC> This behaviour is ONLY as described when the hostname is a symbolic CC> name like "News.CIS.DFN.DE". When i always resolve the name to an ip CC> address before i give it as argument to `open-network-stream', it CC> works again after having failed. CC> I know that this isn't a genuine Gnus problem, it might be a problem CC> of `open-network-stream' or even my network configuration. Maybe you CC> could give me a hint. With the workaround below it works as expected. CC> (defun cc-resolve-address( domain ) CC> (save-excursion CC> (let ((output-buf (generate-new-buffer " *resolve-address*"))) CC> (unwind-protect CC> (progn CC> (set-buffer output-buf) (and (eq (call-process CC> "/usr/bin/nslookup" nil output-buf nil CC> "-retries=1" domain) CC> 0) CC> (> (point-max) 2) (goto-char (point-max)) (when CC> (re-search-backward (concat "^Name: [ ]*" CC> domain "\n" CC> "Address: [ CC> ]*\\(.*\\)$") CC> nil t) CC> (match-string 1)))) CC> ;; unwind-protect cleanup CC> (kill-buffer output-buf))))) CC> (defun nntp-open-network-stream( buffer ) CC> (let ( (host nntp-address) ) CC> (when (not (string-match "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" CC> host)) CC> (setq host (cc-resolve-address host))) CC> (if host CC> (open-network-stream "nntpd" buffer host nntp-port-number) CC> ;; kill buffer due to a possible bug in nntp-open-connection CC> (kill-buffer buffer) (error "nntp-open-network-stream: couldn't CC> resolve %s" nntp-address)))) CC> Best regards, cu, -cc- -- => GNU Emacs Webring @ CC> <= Look Ma, this man CC> can twist his fingers as if they were made of rubber, isn't that CC> amazing? -- Not really, he's been using emacs for years...! -- Jake Colman Principia Partners LLC Phone: (201) 946-0300 Harborside Financial Center Fax: (201) 946-0320 902 Plaza II Beeper: (800) 928-4640 Jersey City, NJ 07311 E-mail: colman@ppllc.com E-mail: jcolman@jnc.com web: http://www.ppllc.com microsoft: "where do you want to go today?" linux: "where do you want to go tomorrow?" BSD: "are you guys coming, or what?"