Ticket #5381 defect new
Handling of LINEMODE_* commands in twisted.conch.telnet.Telnet
|Reported by:||pwegrzyn||Owned by:|
The problem I encounter can even be reproduced with demo_manhole.tac.
Pressing the Ctrl-D combination on the client side sends 0xFF 0xEC sequence, which leads to the following exception on the server side:
File "/usr/lib/python2.7/dist-packages/twisted/internet/selectreactor.py", line 146, in _doReadOrWrite why = getattr(selectable, method)() File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 460, in doRead return self.protocol.dataReceived(data) File "/usr/lib/python2.7/dist-packages/twisted/conch/telnet.py", line 512, in dataReceived raise ValueError("Stumped", b) exceptions.ValueError: ('Stumped', '\xec')
Looking at the source of dataReceived(), I guess that the following code should be modified:
elif b in (NOP, DM, BRK, IP, AO, AYT, EC, EL, GA): self.state = 'data' if appDataBuffer: self.applicationDataReceived(''.join(appDataBuffer)) del appDataBuffer[:] self.commandReceived(b, None)
Shouldn't the condition in the first line also accept LINEMODE_EOF, LINEMODE_SUSP and LINEMODE_ABORT ?