bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19583: nntp-open-server: wrong buffer for nnoo-change-server; breaks


From: Ivan Shmakov
Subject: bug#19583: nntp-open-server: wrong buffer for nnoo-change-server; breaks url-news
Date: Tue, 13 Jan 2015 16:12:25 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Package: emacs
Tags: patch

        As of 88bc8332eb14 (2015-01-07 13:51:41 +0000), nntp-open-server
        appears to call nnoo-change-server without switching to
        nntp-server-buffer first, thus installing the local variables in
        the whatever buffer current at the time it’s called.  One of
        these variables is nntp-port-number, which means that when
        open-protocol-stream is called in the proper buffer later, it
        gets 0 for the port number to connect, and thus fails.

        This affects url-retrieve-synchronously; consider, e. g.:

(let ((url-news-server "news.gmane.org"))
  (url-retrieve-synchronously "87y4p9y2cq.fsf@violet.siamics.net"">news:87y4p9y2cq.fsf@violet.siamics.net";))

        Please thus consider the patch MIMEd.

        * lisp/gnus/nntp.el (nntp-open-server): Switch to
        nntp-server-buffer temporarily while calling nnoo-change-server.

        To note is that to get url-retrieve-synchronously working in
        this case, I had to comment out the :starttls-function argument
        to open-protocol-stream in nntp-open-connection (an issue I
        haven’t investigated much as of yet, but which may be related to
        the use of a self-signed certificate), /and/ define the default
        port for the ‘news’ URI scheme, like the (untested) patch MIMEd.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A
--- a/lisp/gnus/nntp.el 2015-01-01 22:26:41 +0000
+++ b/lisp/gnus/nntp.el
@@ -1066,7 +1066,8 @@ deffoo nntp-open-server (server &optional defs 
connectionless)
       (setq defs (cons (list 'nntp-port-number (car defs)) (cdr defs))))
     (unless (assq 'nntp-address defs)
       (setq defs (append defs (list (list 'nntp-address server)))))
-    (nnoo-change-server 'nntp server defs)
+    (with-current-buffer nntp-server-buffer
+      (nnoo-change-server 'nntp server defs))
     (if connectionless
        t
       (or (nntp-find-connection nntp-server-buffer)
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el 2015-01-13 15:48:37 +0000
@@ -1282,11 +1283,12 @@ defun nntp-open-connection (buffer)
                     :end-of-command "^\\([2345]\\|[.]\\).*\n"
                     :capability-command "HELP\r\n"
                     :success "^3"
-                    :starttls-function
-                    (lambda (capabilities)
-                      (if (not (string-match "STARTTLS" capabilities))
-                          nil
-                        "STARTTLS\r\n")))
+                    ; :starttls-function
+                    ; (lambda (capabilities)
+                    ;   (if (not (string-match "STARTTLS" capabilities))
+                    ;     nil
+                    ;   "STARTTLS\r\n"))
+                    )
                  (funcall nntp-open-connection-function pbuffer)))
            (error
             (nnheader-report 'nntp ">>> %s" err))
--- a/lisp/url/url-news.el      2015-01-01 22:26:41 +0000
+++ b/lisp/url/url-news.el      2015-01-13 16:05:25 +0000
@@ -28,6 +28,9 @@
 (autoload 'url-warn "url")
 (autoload 'gnus-group-read-ephemeral-group "gnus-group")
 
+(defconst url-news-default-port 119 "Default NNTP port.")
+(defconst url-snews-default-port 563 "Default NNTPS port.")
+
 ;; Unused.
 ;;; (defgroup url-news nil
 ;;;   "News related options."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]