commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Gl├╝ck <>
Subject Re: [PATCH][HttpClient] bug 12607
Date Tue, 24 Sep 2002 08:14:33 GMT
Jeff Dever wrote:
 > Well it looks like the else is trying to "correct" the error where
 > there is a spurious '\r' by writing the full /r/n to the output
 > stream and trys again.

Not quite.
This piece of code is used to grab the chunk length of the next chunk 
from the stream which is on a line that looks like:
1b4; some textual comment\r\n

A hex value followed by an optional semicolon and a comment. The \r\n is 
required. Binary data is not allowed after the semicolon.

Normally this code omits the trailing \r\n in the result. But if it 
finds a \r NOT followed by a \n it would include the \r in the result 
and continue until a \r\n is found.

 >  But it doesn't try to correct for a '\n' in
 > the same way (it just writes it out in state 0).  This does not look
 > particularly valuable.

This is not necessary. A single \n would be included in the result 

 > Is it possible that we would be reading over some binary data that
 > might have some valid \r or \n hex values?

No binary data allowed here.

 > In that case we should
 > try to correct for the spurious '\n' as well ...  Otherwise throwing
 > a IOException seems prudent.

Not sure if single \n or \r is allowed here or not. Maybe leave it as it is.

"Real world guys" anyone?

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message