Author: sebb
Date: Wed Apr  6 12:45:35 2011
New Revision: 1089430

URL: http://svn.apache.org/viewvc?rev=1089430&view=rev
Log:
Simplify calculation of header size

Modified:
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1089430&r1=1089429&r2=1089430&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
 Wed Apr  6 12:45:35 2011
@@ -264,8 +264,9 @@ public class HTTPHC4Impl extends HTTPHCA
 
             // record some sizes to allow HTTPSampleResult.getBytes() with 
different options
             res.setContentLength((int) entity.getContentLength());
-            res.setHeadersSize(res.getResponseHeaders().replaceAll("\n", 
"\r\n") // $NON-NLS-1$ $NON-NLS-2$
-                    .length() + 2); // add 2 for a '\r\n' at end of headers 
(before data)
+            res.setHeadersSize(res.getResponseHeaders().length() // condensed 
length
+                    +httpResponse.getAllHeaders().length+1 // Add \r for each 
header and initial header
+                    +2); // final \r\n before data
             if (log.isDebugEnabled()) {
                 log.debug("ResponseHeadersSize=" + res.getHeadersSize() + " 
Content-Length=" + res.getContentLength()
                         + " Total=" + (res.getHeadersSize() + 
res.getContentLength()));



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to