Author: sebb
Date: Sun Apr 22 06:50:38 2007
New Revision: 531180

URL: http://svn.apache.org/viewvc?view=rev&rev=531180
Log:
Bug 42185 - If a HTTP Sampler follows a redirect, and is set up to download 
images, then images are downloaded multiple times

Modified:
    
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jakarta/jmeter/branches/rel-2-2/xdocs/changes.xml

Modified: 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?view=diff&rev=531180&r1=531179&r2=531180
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
 Sun Apr 22 06:50:38 2007
@@ -1114,6 +1114,7 @@
         * @return
         */
        protected HTTPSampleResult resultProcessing(boolean 
areFollowingRedirect, int frameDepth, HTTPSampleResult res) {
+               boolean wasRedirected = false;
                if (!areFollowingRedirect) {
                        if (res.isRedirect()) {
                                log.debug("Location set to - " + 
res.getRedirectLocation());
@@ -1121,6 +1122,7 @@
                                if (getFollowRedirects()) {
                                        res = followRedirects(res, frameDepth);
                                        areFollowingRedirect = true;
+                                       wasRedirected = true;
                                }
                        }
                }
@@ -1131,7 +1133,12 @@
                                // If we followed redirects, we already have a 
container:
                                HTTPSampleResult container = (HTTPSampleResult) 
(areFollowingRedirect ? res.getParent() : res);
 
-                               res = downloadPageResources(res, container, 
frameDepth);
+                               // Only download page resources if we were not 
redirected.
+                               // If we were redirected, the page resources 
have already been
+                               // downloaded for the sample made for the 
redirected url
+                               if(!wasRedirected) {
+                                       res = downloadPageResources(res, 
container, frameDepth);
+                               }
                        }
                }
                return res;

Modified: jakarta/jmeter/branches/rel-2-2/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/xdocs/changes.xml?view=diff&rev=531180&r1=531179&r2=531180
==============================================================================
--- jakarta/jmeter/branches/rel-2-2/xdocs/changes.xml (original)
+++ jakarta/jmeter/branches/rel-2-2/xdocs/changes.xml Sun Apr 22 06:50:38 2007
@@ -211,6 +211,7 @@
 <li>Bug 41518 - JMeter changes the HTTP header Content Type for POST 
request</li>
 <li>Bug 42156 - HTTPRequest HTTPClient incorrectly urlencodes parameter value 
in POST</li>
 <li>Bug 42184 - Number of bytes for subsamples not added to sample when sub 
samples are added</li>
+<li>Bug 42185 - If a HTTP Sampler follows a redirect, and is set up to 
download images, then images are downloaded multiple times</li>
 </ul>
 
 <h3>Version 2.2</h3>



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

Reply via email to