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 2007/10/24 19:05:42 UTC
svn commit: r587929 -
/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
Author: sebb
Date: Wed Oct 24 10:05:39 2007
New Revision: 587929
URL: http://svn.apache.org/viewvc?rev=587929&view=rev
Log:
If normal stream is gzipped, then error stream is also gzipped
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=587929&r1=587928&r2=587929&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 Wed Oct 24 10:05:39 2007
@@ -209,9 +209,11 @@
return NULL_BA;
}
+ // works OK even if ContentEncoding is null
+ boolean gzipped = ENCODING_GZIP.equals(conn.getContentEncoding());
+
try {
- // works OK even if ContentEncoding is null
- if (ENCODING_GZIP.equals(conn.getContentEncoding())) {
+ if (gzipped) {
in = new BufferedInputStream(new GZIPInputStream(conn.getInputStream()));
} else {
in = new BufferedInputStream(conn.getInputStream());
@@ -235,7 +237,11 @@
else {
log.info("Error Response Code: "+conn.getResponseCode());
}
- in = new BufferedInputStream(errorStream);
+ if (gzipped) {
+ in = new BufferedInputStream(new GZIPInputStream(errorStream));
+ } else {
+ in = new BufferedInputStream(errorStream);
+ }
} catch (Exception e) {
log.error("readResponse: "+e.toString());
Throwable cause = e.getCause();
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org