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: 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;
 +     }
 

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