You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jakarta.apache.org by se...@apache.org on 2011/04/06 14:44:28 UTC
svn commit: r1089429 -
/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
Author: sebb
Date: Wed Apr 6 12:44:28 2011
New Revision: 1089429
URL: http://svn.apache.org/viewvc?rev=1089429&view=rev
Log:
Simplify calculation of status line length
Modified:
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java?rev=1089429&r1=1089428&r2=1089429&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java (original)
+++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java Wed Apr 6 12:44:28 2011
@@ -340,16 +340,12 @@ public class HTTPHC3Impl extends HTTPHCA
* @return the size response headers (in bytes)
*/
private static int calculateHeadersSize(HttpMethodBase httpMethod) {
- int headerSize = 0;
- headerSize += 9 // Http proto length + 1 space (i.e.: "HTTP/1.x ")
- + String.valueOf(httpMethod.getStatusCode()).length() + 1 // add one space
- + httpMethod.getStatusText().length() + 2; // add a \r\n
+ int headerSize = httpMethod.getStatusLine().toString().length()+2; // add a \r\n
Header[] rh = httpMethod.getResponseHeaders();
for (int i = 0; i < rh.length; i++) {
headerSize += (rh[i]).toString().length(); // already include the \r\n
}
headerSize += 2; // last \r\n before response data
- // add response data length to headerSize
return headerSize;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org