This is the mail archive of the
java-prs@sourceware.cygnus.com
mailing list for the Java project.
Re: java.net/170: HTTP client code treats headers as body
- To: warrenl at cygnus dot com
- Subject: Re: java.net/170: HTTP client code treats headers as body
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: 10 Mar 2000 02:30:01 -0000
- Cc: java-prs at sourceware dot cygnus dot com,
- Reply-To: Bryce McKinlay <bryce at albatross dot co dot nz>
The following reply was made to PR java.net/170; it has been noted by GNATS.
From: Bryce McKinlay <bryce@albatross.co.nz>
To: francis@ecal.com
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: java.net/170: HTTP client code treats headers as body
Date: Fri, 10 Mar 2000 15:21:09 +1300
Actually, the second part of the 170 patch is wrong, I think. The http status
line is what is returned by getHeaderField(0), so it shouldn't be skipped.
regards
[ bryce ]
@@ -247,6 +246,9 @@
boolean gotnl = false;
byte[] ch = new byte[1];
ch[0] = (byte) '\n';
+
+ boolean isFirst=true;
+
while (true)
{
// Check for leftover byte from non-'\n' after a '\r'.
@@ -266,6 +268,13 @@
}
}
line = line + new String(buf, 0, i);
+
+ if (isFirst) // skip the status line
+ {
+ isFirst=false;
+ line="";
+ continue;
+ }