Author: sebb
Date: Sat Dec 10 10:10:22 2005
New Revision: 355760

URL: http://svn.apache.org/viewcvs?rev=355760&view=rev
Log:
Add gzip decoding

Modified:
    
jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java

Modified: 
jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
URL: 
http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java?rev=355760&r1=355759&r2=355760&view=diff
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
 Sat Dec 10 10:10:22 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.jmeter.protocol.http.sampler;
 
+import java.io.BufferedInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -26,6 +27,7 @@
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.zip.GZIPInputStream;
 
 import org.apache.commons.httpclient.ConnectMethod;
 import org.apache.commons.httpclient.DefaultMethodRetryHandler;
@@ -524,6 +526,10 @@
                        // Request sent. Now get the response:
             InputStream instream = httpMethod.getResponseBodyAsStream();
             
+            if 
(ENCODING_GZIP.equals(httpMethod.getResponseHeader(TRANSFER_ENCODING))) {
+                instream = new GZIPInputStream(instream);
+            }
+
             //int contentLength = httpMethod.getResponseContentLength();Not 
visible ...
             //TODO size ouststream according to actual content length
             ByteArrayOutputStream outstream = new 
ByteArrayOutputStream(4*1024);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to