Bug in Net::Telnet ? [Newbie]

D

Dany Cayouette

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
 
D

Dany Cayouette

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


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,413
Latest member
KeiraLight

Latest Threads

Top