Wrong calculation of content lengths and additional \r's together with Kaffe

Archie Cobbs archie at whistle.com
Wed Mar 10 12:57:14 PST 1999

Helge-Frank Zimpel writes:
> I compiled JServ (version JServ 1.0b1) together with transvirtual 
> kaffe on the Cobalt Qube (Linux/MIPS).
> There something strange happens. A out.print("test\n") gives 
> "test\r\n" as output and the content size is calculated one 
> character to small. For every break, the content-size is calculated
> one character to small. Because of this, the browser didn't stop 
> loading the page (especially when using stylesheets, netscape is 
> very sensitively to the wrong content-length).
> My questions:
> Where is the calculation of content-length done? (JSDK, JServ, 
> Apache?)
> Is it kaffe, which adds the \r before the \n? (if I use kaffe at the
> command-line and make a println(), everything is correct) What 
> might be a
> possible workaround?

I think that \r\n is required in the HTTP headers by the spec.
Therefore, probably JServ or Apache is adding it.

You might check on their mailing list, FAQ, and/or web site.
What is your 

Note also that PrintStream.println() uses the "line.separator"
property to determine between \n and \r\n.


Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com

More information about the kaffe mailing list