From: Dany Cayouette Date: 2004-09-04T07:45:19+09:00 Subject: Re: Bug in Net::Telnet ? [Newbie] Sorry... something was not clear... I will receive the name thing from the remote device, but it shows up on different lines in Dump_log (I suspect different packet on network but not sure)... i.e. < 0x00000: ff fe 1f ff fe 18 ff fa 18 01 ff f0 ............ > 0x00000: ff fc 1f ... > 0x00000: ff fc 18 ... < 0x00000: 61 64 6d .... On Fri, 3 Sep 2004 18:25:30 -0400 Dany Cayouette wrote: > Greetings, > I'm a newbie at Ruby. I think there might be a bug in Net::Telnet from > ruby 1.8.1. > > #ruby --version > ruby 1.8.1 (2003-12-25) [sparc-solaris2.8] > > > Looking at the output from Dump_log, sometimes the remote device will send telnet control sequence follow by some output > > e.g. > < 0x00000: ff fe 1f ff fe 18 ff fa 18 01 ff f0 61 64 6d ... > > Then it works as expected, but sometimes I only get > > ff fe 1f ff fe 18 ff fa 18 01 ff f0 > > And in that scenario, I think waitfor and preprocess methods don't work correctly. > > In waitfor, this seems to match > > elsif pt = c.rindex(/#{IAC}[^#{IAC}#{AO}#{AYT}#{DM}#{IP}#{NOP}]?\z/n > o) > buf = preprocess(c[0 ... pt]) > rest = c[pt .. -1] > > so we send only a partial telnet sub-option to preprocess > ff fe 1f ff fe 18 ff fa 18 01 > > and it looks like some telnet control character will be send back to the caller of waitfor. > > I'm not sure that is the expected behavior, but since when the remote device send extra output with the same control sequence, I get different results... I think it is not the intended behavior. > > Can someone help me out and tell me the best way to 'fix it' (I'm a newbie!!) > > Thanks, > Dany