Author: pferraro
Date: 2008-12-10 22:46:49 -0500 (Wed, 10 Dec 2008)
New Revision: 2121
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
Use constant for new line
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-12-10
22:35:08 UTC (rev 2120)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-12-11
03:46:49 UTC (rev 2121)
@@ -77,6 +77,8 @@
@ThreadSafe
public class DefaultMCMPHandler extends AbstractMCMPHandler
{
+ private static final String NEW_LINE = "\r\n";
+
protected static final Logger log = Logger.getLogger(DefaultMCMPHandler.class);
/** The string manager for this package. */
@@ -743,19 +745,23 @@
}
}
- private String sendRequest(Proxy proxy, String request, char[] body, int length)
throws IOException
+ private String sendRequest(Proxy proxy, String command, char[] body, int length)
throws IOException
{
Writer writer = proxy.getConnectionWriter();
- writer.write(request);
- writer.write("\r\n");
+ writer.write(command);
+ writer.write(NEW_LINE);
- writer.write("Content-Length: " + length + "\r\n");
- writer.write("User-Agent: ClusterListener/1.0\r\n");
- writer.write("Connection: Keep-Alive\r\n");
- writer.write("\r\n");
+ writer.write("Content-Length: ");
+ writer.write(Integer.toString(length));
+ writer.write(NEW_LINE);
+ writer.write("User-Agent: ClusterListener/1.0");
+ writer.write(NEW_LINE);
+ writer.write("Connection: Keep-Alive");
+ writer.write(NEW_LINE);
+ writer.write(NEW_LINE);
writer.write(body, 0, length);
- writer.write("\r\n");
+ writer.write(NEW_LINE);
writer.flush();
// Read the first response line and skip the rest of the HTTP header
Show replies by date