hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: [PATCH] Single line feed treated as false connection close
Date Sat, 18 Oct 2003 17:18:01 GMT
Tim,
I tried to make a test case for the alleged bug in the
HttpParser#readRawLine, but failed to reproduce it. As far as I am
concerned the HttpParser is actually OK. The results produced by
HttpParser in my opinion make sense. I attach a test case below that I
believe supports my assertion. If there is something that I am missing,
please do not hesitate to point it out. 

The real culprit in my opinion is this code in 
HttpMethodBase#readStatusLine(HttpState, HttpConnection)

<snip>
//read out the HTTP status string
String statusString = conn.readLine();
while ((statusString != null) && !statusString.startsWith("HTTP")) {
  ...
  statusString = conn.readLine();
}
</snip>

The code above would also fail to recognise a response status line if it
had a blank or a series of blanks in front of "HTTP".

I'll be working on a patch to address the problem. 

Many thanks for tracking it down, though.

Cheers

Oleg

On Wed, 2003-10-15 at 23:28, Tim McCune wrote:
> This patch is against 2.0rc2.
> I ran into a problem where the HttpClient kept thinking that the
> connection was closed while talking to an IIS 5.0 server, even though my
> web browser could load the page fine.  Turns out that the server was
> sending a line feed as the first byte of the response, which HttpClient
> treats as a closed connection due to a bug in HttpParser. 

Mime
View raw message