Author: sebb Date: Tue Nov 17 18:13:26 2009 New Revision: 881427 URL: http://svn.apache.org/viewvc?rev=881427&view=rev Log: Set response code for cached content to 204 - No Content Set URL and method in response eariler
Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java?rev=881427&r1=881426&r2=881427&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java (original) +++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java Tue Nov 17 18:13:26 2009 @@ -212,8 +212,6 @@ } if (res != null) { - res.setURL(u); - res.setHTTPMethod(method); res.setRequestHeaders(getConnectionHeaders(conn)); res.setCookies(cookies); } @@ -452,6 +450,8 @@ res.setMonitor(isMonitor()); res.setSampleLabel(urlStr); + res.setURL(url); + res.setHTTPMethod(method); res.sampleStart(); // Count the retries as well in the time @@ -460,8 +460,7 @@ if (cacheManager != null && GET.equalsIgnoreCase(method)) { if (cacheManager.inCache(url)) { res.sampleEnd(); - res.setResponseCodeOK(); - res.setResponseMessage("Cached"); + res.setResponseNoContent(); res.setSuccessful(true); return res; } Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java?rev=881427&r1=881426&r2=881427&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java (original) +++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java Tue Nov 17 18:13:26 2009 @@ -628,7 +628,6 @@ setConnectionAuthorization(httpClient, u, getAuthManager()); if (res != null) { - res.setURL(u); res.setCookies(cookies); } @@ -840,6 +839,8 @@ res.setSampleLabel(urlStr); // May be replaced later res.setHTTPMethod(method); + res.setURL(url); + res.sampleStart(); // Count the retries as well in the time HttpClient client = null; InputStream instream = null; @@ -863,8 +864,7 @@ if (cacheManager != null && GET.equalsIgnoreCase(method)) { if (cacheManager.inCache(url)) { res.sampleEnd(); - res.setResponseCodeOK(); - res.setResponseMessage("Cached"); + res.setResponseNoContent(); res.setSuccessful(true); return res; } --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-dev-unsubscr...@jakarta.apache.org For additional commands, e-mail: jmeter-dev-h...@jakarta.apache.org