Author: sebb
Date: Wed Feb 11 14:43:46 2009
New Revision: 743349

URL: http://svn.apache.org/viewvc?rev=743349&view=rev
Log:
Add X-Sleep header to make mirror pause when returning data

Modified:
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java?rev=743349&r1=743348&r2=743349&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java
 Wed Feb 11 14:43:46 2009
@@ -93,6 +93,10 @@
             if(contentLengthHeaderValue != null) {
                 contentLength = new 
Integer(contentLengthHeaderValue).intValue();
             }
+            String sleepHeaderValue = getRequestHeaderValue(headerString, 
"X-Sleep"); //$NON-NLS-1$
+            if(sleepHeaderValue != null) {
+                Thread.sleep(Integer.parseInt(sleepHeaderValue));
+            }
             String transferEncodingHeaderValue = 
getRequestHeaderValue(headerString, "Transfer-Encoding"); //$NON-NLS-1$
             if(transferEncodingHeaderValue != null) {
                 isChunked = 
transferEncodingHeaderValue.equalsIgnoreCase("chunked"); //$NON-NLS-1$
@@ -142,6 +146,8 @@
             out.flush();
         } catch (IOException e) {
             log.error("", e);
+        } catch (InterruptedException e) {
+            log.error("", e);
         } finally {
             JOrphanUtils.closeQuietly(out);
             JOrphanUtils.closeQuietly(in);



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

Reply via email to