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 03:30:00 -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: John Stracke <francis@ecal.com>, java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: java.net/170: HTTP client code treats headers as body
Date: Fri, 10 Mar 2000 16:25:38 +1300
John Stracke wrote:
> + public int getResponseCode() throws IOException
> + {
> + getHttpHeaders();
> + return responseCode;
> + }
For efficiency we should change all the getHttpHeaders() calls to:
if (! gotHeaders)
getHttpHeaders();
and remove the gotHeaders check from getHttpHeaders(). This avoids the overhead of the
extra method call in the common case.
> + responseCode=(new Integer(responseCodeStr)).intValue();
Integer.parseInt(responseCodeStr); would be more efficient here.
regards
[ bryce ]