Author: jfrederic.clere(a)jboss.com
Date: 2011-12-22 08:55:11 -0500 (Thu, 22 Dec 2011)
New Revision: 1904
Modified:
branches/2.1.x/java/org/jboss/web/cluster/ClusterListener.java
Log:
Fix the mod_cluster ping tests.
Modified: branches/2.1.x/java/org/jboss/web/cluster/ClusterListener.java
===================================================================
--- branches/2.1.x/java/org/jboss/web/cluster/ClusterListener.java 2011-12-21 13:08:48 UTC
(rev 1903)
+++ branches/2.1.x/java/org/jboss/web/cluster/ClusterListener.java 2011-12-22 13:55:11 UTC
(rev 1904)
@@ -712,7 +712,23 @@
return result.toString();
}
public String doProxyPing(String scheme, String host, int port) {
- return doProxyPing(scheme + "://" + host + String.valueOf(port));
+ HashMap<String, String> parameters = new HashMap<String, String>();
+ if (scheme != null)
+ parameters.put("Scheme", scheme);
+ if (host != null)
+ parameters.put("Host", host);
+ if (port != 0)
+ parameters.put("Port", String.valueOf(port));
+ // Send PING * request
+ Proxy[] local = proxies;
+ StringBuffer result = new StringBuffer();
+ for (int i = 0; i < local.length; i++) {
+ result.append("Proxy[").append(i).append("]:
[").append(local[i].address)
+ .append(':').append(local[i].port).append("]:
\r\n");
+ result.append(sendRequest("PING", true, parameters, i));
+ result.append("\r\n");
+ }
+ return result.toString();
}
/**
Show replies by date