From c8cad03cb88bfc5c65c5c8f1e6b84f2022082009 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Sat, 11 Jun 2005 22:46:49 +0000 Subject: [PATCH] Bug 35281 - allow max redirects to be overriden by a property git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/trunk@325445 13f79535-47bb-0310-9956-ffa450edef68 Former-commit-id: b554948cadecfbbc9ead4775b86a560183edd084 --- bin/jmeter.properties | 9 +++++++-- .../jmeter/protocol/http/sampler/HTTPSamplerBase.java | 7 +++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bin/jmeter.properties b/bin/jmeter.properties index 25ff4b0066..fad83047cf 100644 --- a/bin/jmeter.properties +++ b/bin/jmeter.properties @@ -29,7 +29,7 @@ cookies=cookies # Save test plans and test logs in 2.0 format #file_format=2.0 # Just test plans (jmx) -#file_format.testplan=2.0 +file_format.testplan=2.0 # Just test logs (jtl) #file_format.testlog=2.0 @@ -251,6 +251,11 @@ upgrade_properties=/bin/upgrade.properties #htmlParser.className=org.apache.jmeter.protocol.http.parser.JTidyHTMLParser #htmlParser.className=org.apache.jmeter.protocol.http.parser.RegexpHTMLParser +# Maximum redirects to follow in a single sequence (default 5) +#httpsampler.max_redirects=5 +# Maximum frame/iframe nesting depth (default 5) +#httpsampler.max_frame_depth=5 + # Put the start time stamp in logs instead of the end #sampleresult.timestamp.start=true @@ -351,4 +356,4 @@ upgrade_properties=/bin/upgrade.properties # the controllers are initialised. This is so controllers can access variables earlier. # In case this causes problems, the previous behaviour can be restored by uncommenting # the following line. -#jmeterthread.startearlier=false \ No newline at end of file +#jmeterthread.startearlier=false diff --git a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java b/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java index 177c26fa44..554116003d 100644 --- a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java +++ b/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java @@ -42,6 +42,7 @@ import org.apache.jmeter.testelement.property.JMeterProperty; import org.apache.jmeter.testelement.property.PropertyIterator; import org.apache.jmeter.testelement.property.StringProperty; import org.apache.jmeter.testelement.property.TestElementProperty; +import org.apache.jmeter.util.JMeterUtils; import org.apache.jorphan.logging.LoggingManager; import org.apache.jorphan.util.JOrphanUtils; import org.apache.log.Logger; @@ -597,9 +598,11 @@ public abstract class HTTPSamplerBase extends AbstractSampler implements return path; } - protected static final int MAX_REDIRECTS = 5; + protected static final int MAX_REDIRECTS = + JMeterUtils.getPropDefault("httpsampler.max_redirects",5); - protected static final int MAX_FRAME_DEPTH = 5; + protected static final int MAX_FRAME_DEPTH = + JMeterUtils.getPropDefault("httpsampler.max_frame_depth",5); /* * (non-Javadoc)