Re: [Twisted-Python] getPeer() inside conch

2009-10-02 Thread Paul Swartz
On Thu, Oct 1, 2009 at 10:53 PM, Glyph Lefkowitz wrote: > On Thu, Oct 1, 2009 at 10:21 PM, Benjamin Rutt wrote: >> >> (A/B) it looks like the SSHChannel implementation of getPeer() is faulty. >> If I change my two-line implementation of getPeer() inside >> SSHSessionProcessProtocol to simply 'ret

Re: [Twisted-Python] getPeer() inside conch

2009-10-01 Thread Glyph Lefkowitz
On Thu, Oct 1, 2009 at 10:21 PM, Benjamin Rutt wrote: > (A/B) it looks like the SSHChannel implementation of getPeer() is faulty. > If I change my two-line implementation of getPeer() inside > SSHSessionProcessProtocol to simply 'return self.session.getPeer()', I get: > > File > "/home/ruttbe/d

Re: [Twisted-Python] getPeer() inside conch

2009-10-01 Thread Benjamin Rutt
(A/B) it looks like the SSHChannel implementation of getPeer() is faulty. If I change my two-line implementation of getPeer() inside SSHSessionProcessProtocol to simply 'return self.session.getPeer()', I get: File "/home/ruttbe/dev/python/twisted-8.2.0-inst/lib/python/twisted/conch/ssh/session.p

Re: [Twisted-Python] getPeer() inside conch

2009-09-29 Thread Glyph Lefkowitz
On Tue, Sep 29, 2009 at 7:16 PM, Benjamin Rutt wrote: > The code: > > print 'hello, peer %s' % (self.terminal.transport.getPeer()) > > Fails with: > > AttributeError: SSHSessionProcessProtocol instance has no attribute > 'getPeer' > Oops. Looks like my reading of the code was wrong. On

Re: [Twisted-Python] getPeer() inside conch

2009-09-29 Thread Benjamin Rutt
The code: print 'hello, peer %s' % (self.terminal.transport.getPeer()) Fails with: AttributeError: SSHSessionProcessProtocol instance has no attribute 'getPeer' One possible patch to twisted 8.2.0's conch/ssh/session.py's SSHSessionProcessProtocol class to add a getPeer() method would b

Re: [Twisted-Python] getPeer() inside conch

2009-09-28 Thread Glyph Lefkowitz
On Mon, Sep 28, 2009 at 8:10 PM, Benjamin Rutt wrote: > But, it seems the recvline.HistoricRecvLine class wants me to use > self.terminal rather than self.transport to talk to the client. That's > fine, but it seems that self.terminal lacks a getPeer() method. How do I > find out the IP addres

[Twisted-Python] getPeer() inside conch

2009-09-28 Thread Benjamin Rutt
Hello. I'm moderately experienced with twisted, and am starting out writing an ssh server using conch. I'm writing a protocol which inherits from the recvline.HistoricRecvLine class. It has connectionMade() and lineReceived() methods so it feels a lot like the twisted.protocols.basic.LineReceiver