Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
Subject: gnus-parse-news-url fails if port number is given
Date: Fri, 18 Feb 2005 15:14:42 +0100	[thread overview]
Message-ID: <v9r7je7y5p.fsf@marauder.physik.uni-ulm.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

Hi,

Gnus doesn't parse news URLs correctly if a port number is specified:

news://newsarchiv.arcor.de:119/4213714c$0$24925$9b4e6d93@newsread2.arcor-online.net

Without the port number, it works:

news://newsarchiv.arcor.de/4213714c$0$24925$9b4e6d93@newsread2.arcor-online.net

Is the following patch the right way to fix this?  Especially, I'm
unsure if the let binding of `nntp-port-number' is the right way.
Other suggestions?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rs-news-url-port.patch --]
[-- Type: text/x-patch, Size: 1614 bytes --]

--- gnus-art.el	14 Feb 2005 16:56:04 +0100	6.381.2.22
+++ gnus-art.el	18 Feb 2005 14:41:43 +0100	
@@ -6648,15 +6648,18 @@
 		      (cons fun args)))))))
 
 (defun gnus-parse-news-url (url)
-  (let (scheme server group message-id articles)
+  (let (scheme server port group message-id articles)
     (with-temp-buffer
       (insert url)
       (goto-char (point-min))
       (when (looking-at "\\([A-Za-z]+\\):")
 	(setq scheme (match-string 1))
 	(goto-char (match-end 0)))
-      (when (looking-at "//\\([^/]+\\)/")
+      (when (looking-at "//\\([^:/]+\\)\\(:?\\)\\([0-9]+\\)?/")
 	(setq server (match-string 1))
+	(setq port (if (stringp (match-string 3))
+		       (string-to-number (match-string 3))
+		     (match-string 3)))
 	(goto-char (match-end 0)))
 
       (cond
@@ -6669,18 +6672,19 @@
 	(setq group (match-string 1)))
        (t
 	(error "Unknown news URL syntax"))))
-    (list scheme server group message-id articles)))
+    (list scheme server port group message-id articles)))
 
 (defun gnus-button-handle-news (url)
   "Fetch a news URL."
-  (destructuring-bind (scheme server group message-id articles)
+  (destructuring-bind (scheme server port group message-id articles)
       (gnus-parse-news-url url)
     (cond
      (message-id
       (save-excursion
 	(set-buffer gnus-summary-buffer)
 	(if server
-	    (let ((gnus-refer-article-method (list (list 'nntp server))))
+	    (let ((gnus-refer-article-method (list (list 'nntp server)))
+		  (nntp-port-number (or port "nntp")))
 	      (gnus-summary-refer-article message-id))
 	  (gnus-summary-refer-article message-id))))
      (group

[-- Attachment #3: Type: text/plain, Size: 114 bytes --]


Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

             reply	other threads:[~2005-02-18 14:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-18 14:14 Reiner Steib [this message]
2005-02-21 13:40 ` Reiner Steib

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=v9r7je7y5p.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@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).