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/07/09 04:10:31 UTC

svn commit: r554513 - /jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java

Author: sebb
Date: Sun Jul  8 19:10:30 2007
New Revision: 554513

URL: http://svn.apache.org/viewvc?view=rev&rev=554513
Log:
Fix mirror server to work on Unix as well

Modified:
    jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java

Modified: jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java?view=diff&rev=554513&r1=554512&r2=554513
==============================================================================
--- jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java (original)
+++ jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java Sun Jul  8 19:10:30 2007
@@ -35,7 +35,9 @@
 public class HttpMirrorThread extends Thread {
     private static final Logger log = LoggingManager.getLoggerForClass();
 
-	/** Socket to client. */
+    private static final char[] CRLF = new char[] {(byte) 13, (byte) 10};
+
+    /** Socket to client. */
 	private final Socket clientSocket;
 
 	public HttpMirrorThread(Socket _clientSocket) {
@@ -57,13 +59,16 @@
 		try {
 			in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
 			out = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream()));
-			out.println("HTTP/1.0 200 OK");
-			out.println("Content-Type: text/plain");
-			out.println();
+			out.print("HTTP/1.0 200 OK"); //$NON-NLS-1$
+			out.write(CRLF);
+			out.print("Content-Type: text/plain"); //$NON-NLS-1$
+			out.write(CRLF);
+			out.write(CRLF);
 			out.flush();
 			String line;
 			while((line = in.readLine()) != null){
-				out.println(line);
+				out.print(line);
+				out.write(CRLF);
 				if (line.length()==0) break;
 			}
             int c;



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