• Telnetd

    From Bo Simonsen@2:236/100 to All on Saturday, February 27, 2010 10:11:13
    Hi all,

    According to the telnet standard a new line is send by <CR><LF> and just
    a plain carrige return is send by <CR>\0. However it seems like some clients are just sending <CR> or the raw-\0 is lost somewhere. So my current "algorithm" for reading one char is the following.

    1. Read one character from the socket.
    2. If this char is not \r return the character to the BBS.
    3. If it is \r, then use select() with tv.sec/tv.usec=0, and if
    FD_ISSET is true then read one charecter. Return the \r in
    both cases.

    Is this the correct way? It seems to work with almost all clients.

    Notice that this code does not apply to zmodem filetransfers and other
    stuff.

    Bo


    ... Direct from the Ministry of Silly Walks
    ___ MultiMail/Linux v0.49

    --- DayDream BBS/Linux 2.15a (Grab QWK Door)
    * Origin: The Night Express. Running Daydream/Linux. (2:236/100)