[cs631apue] Handling telnet vs nc/browsers

Tejas Nadkarni tnadkarn at stevens.edu
Fri Nov 22 11:03:46 EST 2013


So interesting situation - our code works with browsers and nc since they
place the entire request into the initial buffer and I can parse that
appropriately including carriage returns. However with telnet, hitting
return closes the read request and I have to read again for the next line,
etc.

So while it works perfectly for browsers/nc it processes on the first
return from telnet so can't support headers (while it does for nc/browsers).

Any ideas from others how to work around this? Would it make sense to
detect the client connecting to the socket and change behavior
appropriately?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20131122/a5faab8a/attachment.html>


More information about the cs631apue mailing list