Gnus development mailing list
 help / color / mirror / Atom feed
From: Christoph Conrad <christoph.conrad@gmx.de>
Subject: `open-network-stream' in `nntp-open-network-stream': strange behaviour
Date: 30 Dec 2000 16:45:34 +0100	[thread overview]
Message-ID: <m3n1ddzzgw.fsf@mutzel.brumpf.de> (raw)

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 @ <http://nav.webring.yahoo.com/hub?ring=emacs> <=
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...!



             reply	other threads:[~2000-12-30 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-30 15:45 Christoph Conrad [this message]
2001-01-01 22:11 ` Jake Colman
2001-01-01 22:51   ` Christoph Conrad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3n1ddzzgw.fsf@mutzel.brumpf.de \
    --to=christoph.conrad@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).