This is the mail archive of the java-prs@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: java.net/170: HTTP client code treats headers as body


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 ]
 
 
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]