TIP: Click on subject to list as thread! ANSI
echo: linux_bbs
to: All
from: Bo Simonsen
date: 2010-02-27 10:11:12
subject: Telnetd

Hi all,

According to the telnet standard a new line is send by  and just
a plain carrige return is send by \0. However it seems like some clients
are just sending  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)
SEEN-BY: 3/0 10/1 11/200 201 203 331 14/250 400 34/999 120/228 123/500 128/2
SEEN-BY: 128/187 140/1 222/2 226/0 236/150 249/303 250/1 306 261/20 38 100
SEEN-BY: 261/1381 1404 1406 1410 1418 266/1413 280/1027 320/119 393/68 396/45
SEEN-BY: 633/104 260 267 285 640/954 712/0 313 848 800/432 801/161 189
SEEN-BY: 2222/700 2320/100 105 200 5030/1256
@PATH: 236/100 237/53 236/150 261/38 633/260 712/848 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.