Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-parse-news-url fails if port number is given
@ 2005-02-18 14:14 Reiner Steib
  2005-02-21 13:40 ` Reiner Steib
  0 siblings, 1 reply; 2+ messages in thread
From: Reiner Steib @ 2005-02-18 14:14 UTC (permalink / 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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gnus-parse-news-url fails if port number is given
  2005-02-18 14:14 gnus-parse-news-url fails if port number is given Reiner Steib
@ 2005-02-21 13:40 ` Reiner Steib
  0 siblings, 0 replies; 2+ messages in thread
From: Reiner Steib @ 2005-02-21 13:40 UTC (permalink / raw)


On Fri, Feb 18 2005, Reiner Steib wrote:

> 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

I have committed the patch to the v5-10 branch.

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-21 13:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-18 14:14 gnus-parse-news-url fails if port number is given Reiner Steib
2005-02-21 13:40 ` Reiner Steib

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).