Gnus development mailing list
 help / color / mirror / Atom feed
* [RFC] a better design for nntp-open-* functions
@ 2000-11-08 14:53 Didier Verna
  0 siblings, 0 replies; only message in thread
From: Didier Verna @ 2000-11-08 14:53 UTC (permalink / raw)



                Hi!

        I was not completely satisfied with the design of the
nntp-open-rlogin/telnet functions, so I've hacked something which is better (I
think).

        What bothers me in the current design is that Gnus is, properly
speaking, mistaken about what it does: it /thinks/ it's connecting to an nntp
server whereas it's actually connecting to an intermediate host, and has no
idea of what the real news server is, because it is hidden in the
"parameters". As a consequence, mechanisms such as automatic authinfo
negociation are broken.

        In a better design, Gnus should be aware that it's contacting an
intermediate host, and should also know the name of the real news server. This
basically means that the variable nntp-address should *always* represent the
news server, and *never* represent the intermediate host.

        I've hacked nntp.el in order to do this and I'm (almost) ready to
commit. The change involves a new function and two new vooriables (I've done
this only for the rlogin method, but it is my intention to fix the telnet one
also):

 ,----
| (defvoo nntp-rlogin-address nil
|   "*Address of the remote machine to log in when using the
| `nntp-open-through-rlogin' connection method.")
| 
| (defvoo nntp-rlogin-telnet-command '("telnet" "-8")
|   "*Telnet command to use to connect to the real news server when using the
| `nntp-open-through-rlogin' connection method. By default,
| '(\"telnet\" \"-8\") is used.")
| 
| (defun nntp-open-through-rlogin (buffer)
|   "Open a connection to an nntp through an intermediate host: first rlogin
| to the remote host, and then telnet the real news server from there.
| 
| Please refer to the following variables to customize the connection:
| - `nntp-rlogin-program',
| - `nntp-rlogin-user-name',
| - `nntp-rlogin-address' (this variable *must* be set),
| - `nntp-rlogin-telnet-program',
| - `nntp-address',
| - `nntp-port-number'."
|   (let* ((proc (if nntp-rlogin-user-name
|                    (apply 'start-process
|                           "nntpd" buffer nntp-rlogin-program
|                           "-l" nntp-rlogin-user-name nntp-rlogin-address
|                           (append nntp-rlogin-telnet-command
|                                   (list nntp-address nntp-port-number)))
|                  (apply 'start-process
|                         "nntpd" buffer nntp-rlogin-program nntp-rlogin-address
|                         (append nntp-rlogin-telnet-program
|                                 (list nntp-address nntp-port-number)))
|                  )))
|     (save-excursion
|       (set-buffer buffer)
|       (nntp-wait-for-string "^\r*20[01]")
|       (beginning-of-line)
|       (delete-region (point-min) (point))
|       proc)))
`-----


However, before I commit, I'd like to have opinions on the following points:

1/ I don't know whether nntp-open-rlogin is already available in a a stable
   and released version of Gnus, but if not, I think my function should
   replace the other one. It's really just a better design of an existing
   feature. I'm aware that this would probably break existing user settings,
   but that's what betas are for ;-)

2/ In general, I would also like to change the names of these functions: I for
   instance need a function to open the news server by direct telnet on the
   server (not through a 3rd machine), and `nntp-open-telnet' is the natural
   name for it.


        What do you think ?

-- 
    /     /   _   _       Didier Verna        http://www.inf.enst.fr/~verna/
 - / / - / / /_/ /        EPITA / LRDE         mailto:didier@lrde.epita.fr
/_/ / /_/ / /__ /      14-16 rue Voltaire        Tel. +33 (1) 53 14 59 47
                   94276 Kremlin-Bicêtre cedex   Fax. +33 (1) 44 08 01 99



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-11-08 14:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-08 14:53 [RFC] a better design for nntp-open-* functions Didier Verna

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