jsalvata    2003/11/26 16:59:52

  Modified:    src/protocol/http/org/apache/jmeter/protocol/http/sampler
                        HTTPSampler.java
  Log:
  Fixed bug#21840 by having the redirect results be children
  of the LAST request in the chain, not the reverse.
  
  Revision  Changes    Path
  1.63      +8 -7      
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
  
  Index: HTTPSampler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- HTTPSampler.java  27 Nov 2003 00:31:02 -0000      1.62
  +++ HTTPSampler.java  27 Nov 2003 00:59:52 -0000      1.63
  @@ -136,7 +136,7 @@
   
       /** A number to indicate that the port has not been set.  **/
       public static final int UNSPECIFIED_PORT= 0;
  -    private static final int MAX_REDIRECTS= 10;
  +    private static final int MAX_REDIRECTS= 5; // As recommended by RFC 2068
       protected static String encoding= "iso-8859-1";
       private static final PostWriter postWriter= new PostWriter();
       transient protected HttpURLConnection conn;
  @@ -1007,7 +1007,8 @@
           }
   
           URL newUrl= new URL(loc);
  -        setMethod(GET);
  +        setMethod(GET); // According to RFC 2068, this is an error, but it's
  +                        // what all browsers seem to do.
           setProtocol(newUrl.getProtocol());
           setDomain(newUrl.getHost());
           setPort(newUrl.getPort());
  @@ -1133,10 +1134,10 @@
                   }
   
                   redirectUrl(conn, url);
  -                SampleResult redirectResult= sample(redirects + 1);
  -                res.addSubResult(redirectResult);
  -                res.setSuccessful(redirectResult.isSuccessful());
  -                res.setTime(res.getTime() + redirectResult.getTime());
  +                SampleResult redirect= res;
  +                res= sample(redirects + 1);
  +                res.addSubResult(redirect);
  +                res.setTime(res.getTime()+redirect.getTime());
               }
               log.debug("End : sample, redirects=" + redirects);
               if (isImageParser())
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to