From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/33952 Path: main.gmane.org!not-for-mail From: Christoph Conrad Newsgroups: gmane.emacs.gnus.general Subject: `open-network-stream' in `nntp-open-network-stream': strange behaviour Date: 30 Dec 2000 16:45:34 +0100 Organization: Gnus Information Center Sender: owner-ding@hpc.uh.edu Message-ID: Reply-To: Christoph Conrad NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035169966 27837 80.91.224.250 (21 Oct 2002 03:12:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:12:46 +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 2B652D04A0 for ; Sat, 30 Dec 2000 14:48:28 -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 JAB12259; Sat, 30 Dec 2000 09:47:13 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 30 Dec 2000 09:45:17 -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 JAA22148 for ; Sat, 30 Dec 2000 09:45:06 -0600 (CST) Original-Received: from quimby.gnus.org (quimby.gnus.org [195.204.10.139]) by mailhost.sclp.com (Postfix) with ESMTP id 64578D049D for ; Sat, 30 Dec 2000 10:45:31 -0500 (EST) Original-Received: (from news@localhost) by quimby.gnus.org (8.9.3/8.9.3) id QAA05137 for ding@gnus.org; Sat, 30 Dec 2000 16:45:53 +0100 (CET) Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 59 Original-NNTP-Posting-Host: b1d47.pppool.de Original-X-Trace: quimby.gnus.org 978191152 30941 213.7.29.71 (30 Dec 2000 15:45:52 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 30 Dec 2000 15:45:52 GMT Original-Sender: christoph.conrad@gmx.de X-Public-Key: http://pgp5.ai.mit.edu:11371/pks/lookup?op=get&search=0x1B488DEA User-Agent: Gnus/5.090001 (Oort Gnus v0.01) Emacs/20.7 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:33952 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:33952 Hi! Linux 2.2.14, i386, Emacs 20.7.1, latest CVS Oort Gnus. I have the following problem since a few weeks now, a workaround i found now is at the end of the mail. When `open-network-stream' failed ONE time for a given host (cause i am not online, host overloaded etc.), it fails forever in the same emacs session. If i restart my Emacs, it works again. This behaviour is ONLY as described when the hostname is a symbolic name like "News.CIS.DFN.DE". When i always resolve the name to an ip address before i give it as argument to `open-network-stream', it works again after having failed. I know that this isn't a genuine Gnus problem, it might be a problem of `open-network-stream' or even my network configuration. Maybe you could give me a hint. With the workaround below it works as expected. (defun cc-resolve-address( domain ) (save-excursion (let ((output-buf (generate-new-buffer " *resolve-address*"))) (unwind-protect (progn (set-buffer output-buf) (and (eq (call-process "/usr/bin/nslookup" nil output-buf nil "-retries=1" domain) 0) (> (point-max) 2) (goto-char (point-max)) (when (re-search-backward (concat "^Name: [ ]*" domain "\n" "Address: [ ]*\\(.*\\)$") nil t) (match-string 1)))) ;; unwind-protect cleanup (kill-buffer output-buf))))) (defun nntp-open-network-stream( buffer ) (let ( (host nntp-address) ) (when (not (string-match "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" host)) (setq host (cc-resolve-address host))) (if host (open-network-stream "nntpd" buffer host nntp-port-number) ;; kill buffer due to a possible bug in nntp-open-connection (kill-buffer buffer) (error "nntp-open-network-stream: couldn't resolve %s" nntp-address)))) Best regards, cu, -cc- -- => GNU Emacs Webring @ <= Look Ma, this man can twist his fingers as if they were made of rubber, isn't that amazing? -- Not really, he's been using emacs for years...!