[Patches] [ python-Patches-416079 ] Improvements in 'telnetlib'
noreply@sourceforge.net
noreply@sourceforge.net
Sat, 28 Jul 2001 04:38:21 -0700
Patches item #416079, was opened at 2001-04-14 00:54
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=416079&group_id=5470
Category: library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Lionel Ulmer (bbrox)
Assigned to: Nobody/Anonymous (nobody)
Summary: Improvements in 'telnetlib'
Initial Comment:
This patch does the following :
- fix the debug string output when receiving telnet
commands (the 'c' was reprinted whereas it's 'opt' that
we want to see on the screen)
- added all the telnet options known to arpa/telnet.h
- added the possibility for the user to have it's own
option negotiation callback, thus overriding Python's
default WILL/WONT => DONT, DO/DONT => WONT behaviour
Now, on a design perspective, I did not know what was
best : do as I did or add a __default_callback function
in the telnetlib file that would do the default
behavious and thus preventing the 'if callback:' tests.
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2001-07-28 04:38
Message:
Logged In: YES
user_id=21627
The patch looks good, but I'd like you to improve
standards conformance of the telnet options. I.e. you
should document which version of arpa/telnet.h you've used
as a basis. In addition, you should consider adding telnet
options not listed in this file.
In the past, they were all collected in an RFC; the last
one who did this was RFC 2400. Now, IANA has a separate
table, http://www.iana.org/assignments/telnet-options.
I recommend that you add all those constants in addition
to their telnet.h names, e.g. TOPT_XDL, TOPT_3270,
TOPT_X_3.
As for the callback design: Another option would be to
allow subclassing the telnet class, e.g. a self.do_option
method. I'm not sure what it best here, your current
approach seems fine.
Please also try to draft a patch for
Doc/lib/libtelnetlib.tex. At a minimum, this should
document the callback and the existence of the constants;
if possible, it should give an example of option
negotiation.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=416079&group_id=5470