You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2010/01/11 01:29:30 UTC

svn commit: r897739 - /jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java

Author: sebb
Date: Mon Jan 11 00:29:30 2010
New Revision: 897739

URL: http://svn.apache.org/viewvc?rev=897739&view=rev
Log:
Set latency in error cases

Modified:
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.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=897739&r1=897738&r2=897739&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 Mon Jan 11 00:29:30 2010
@@ -59,6 +59,9 @@
  *
  */
 public class HTTPSampler extends HTTPSamplerBase implements Interruptible {
+    private static final boolean OBEY_CONTENT_LENGTH = 
+        JMeterUtils.getPropDefault("httpsampler.obey_contentlength", false); // $NON-NLS-1$
+
     private static final long serialVersionUID = 233L;
 
     private static final Logger log = LoggingManager.getLoggerForClass();
@@ -233,10 +236,10 @@
 
         final int contentLength = conn.getContentLength();
         if ((contentLength == 0)
-            && JMeterUtils.getPropDefault("httpsampler.obey_contentlength", // $NON-NLS-1$
-            false)) {
+            && OBEY_CONTENT_LENGTH) {
             log.info("Content-Length: 0, not reading http-body");
             res.setResponseHeaders(getResponseHeaders(conn));
+            res.latencyEnd();
             return NULL_BA;
         }
 
@@ -263,6 +266,7 @@
             if (errorStream == null) {
                 log.info("Error Response Code: "+conn.getResponseCode()+", Server sent no Errorpage");
                 res.setResponseHeaders(getResponseHeaders(conn));
+                res.latencyEnd();
                 return NULL_BA;
             }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org