[ee122] The terminating characters

Lisa Fowler fowler at eecs.berkeley.edu
Tue Sep 18 00:12:23 PDT 2007


They are two characters.  As listed in "2.2 Basic Rules" in RFC 1945
http://www.w3.org/Protocols/rfc1945/rfc1945 (as you were suggested to
read and follow per the PDF), CRLF for really really real is supposed
to be a CR followed by an LF.

The ASCII codes for CR (aka "\r") and LR (aka "\n") are listed in the RFC.

A \n is not a \r\n and it is not okay for you to treat an \n as an
\r\n .  It is VERY IMPORTANT that your (part B) client and server
comply with the spec as described in RFC 1945 and in the PDF.

Regarding your other question about the \r\n business, it is your job
to make sure that your client massages the input it receives into
being a compliant request in that regard....

Side note - Why are we being so picky about this?  Well, for one
thing, it's in the RFC.  The other is that "The problem is that unix
expects linebreaks in the 'LF' format (\n), while Windows expects them
in the 'CRLF' format (\r\n)."  This way, similar to the little vs big
endian problem, we standardize on one format.  Therefore, you should
also standardize on what everyone else has already agreed to
standardize, namely the use of a CRLF.

-Lisa


On 9/17/07, Richard Schmidt <huntingtonsurfca at gmail.com> wrote:
> You keep referring to \r\n as the way we know that the server/client has
> finished transmitting.
>
> Are these two characters? Right now, I'm only looking for a \n character. I
> don't quite understand what a CRLF or \r\n, I was guessing that they are the
> same as a newLine, and since the server only echoes back one line, this
> should be okay?
>
> Any help would be great.
>
> Rick
> _______________________________________________
> ee122 mailing list
> ee122 at mailman.ICSI.Berkeley.EDU
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/ee122
>
>


More information about the ee122 mailing list