On 03/18/2015 08:32 PM, 김혜진 wrote: > Hi. > > My real situation is like this : > 1. running telnetd on embedded board. > 2. running client on windows/linux > 3. client works something on connection such as getting big file with > tftp or testing system with automated script for a long time. > 4. client is killed abnormally, for example kill telnet process > 5. At this time, telnetd goes infinite loop and cpu occupation almost > becomes 90%. > > I think this connection should be closed completely and telnetd should > hold for next connection using select(). > but select() returns 1, and it means a socket fd has some changes. > That is telnetd does not catch client already killed. > > (Unfortunatly, PC running telnetd can't reproduce this issue. I > recommended to check any embedded board if you have)
I'm picking off patches from my pending queue in a semi-random order, haven't gotten to this one yet. However, one of my todo items is to unify telnetd and netcat, since I spent a lot of time getting the logic in netcat right. Can you try using netcat's server mode instead of telnetd, and seeing if it handles this case? (I realize this doesn't give you a tty, prompt for a login, pass back the exiting process's return code, or do the environment variable marshalling telnet does. There's a reason I haven't done this unification yet, there's significant work involved. But what I'd like to confirm is that netcat server mode gets the socket plumbing and child lifetime bits right.) (To be honest I just use dropbear ssh for this stuff, telnet hasn't been one of my personal use cases in years.) Thanks, Rob _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
