JBoss Native SVN: r2337 - in trunk/mod_cluster/native: mod_manager and 1 other directories.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-05 10:03:40 -0500 (Thu, 05 Mar 2009)
New Revision: 2337
Modified:
trunk/mod_cluster/native/include/mod_proxy_cluster.h
trunk/mod_cluster/native/mod_manager/mod_manager.c
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Use mod_proxy logic instead ours.
Modified: trunk/mod_cluster/native/include/mod_proxy_cluster.h
===================================================================
--- trunk/mod_cluster/native/include/mod_proxy_cluster.h 2009-03-05 11:06:23 UTC (rev 2336)
+++ trunk/mod_cluster/native/include/mod_proxy_cluster.h 2009-03-05 15:03:40 UTC (rev 2337)
@@ -39,10 +39,9 @@
* @param r request_rec structure.
* @param id ident of the worker.
* @param load load factor to set if test is ok.
- * @param scheme AJP/http/https protocol to use.
* @return 0: All OK 500 : Error
*/
-int (* proxy_node_isup)(request_rec *r, int id, char *scheme, int load);
+int (* proxy_node_isup)(request_rec *r, int id, int load);
};
typedef struct balancer_method balancer_method;
#endif /*MOD_PROXY_CLUSTER_H*/
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-03-05 11:06:23 UTC (rev 2336)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-03-05 15:03:40 UTC (rev 2337)
@@ -1172,10 +1172,10 @@
* Call the ping/pong logic
* Do a ping/png request to the node and set the load factor.
*/
-static int isnode_up(request_rec *r, int id, char *scheme, int Load)
+static int isnode_up(request_rec *r, int id, int Load)
{
if (balancerhandler != NULL) {
- return (balancerhandler->proxy_node_isup(r, id, scheme, Load));
+ return (balancerhandler->proxy_node_isup(r, id, Load));
}
return OK;
}
@@ -1233,7 +1233,7 @@
ap_set_content_type(r, "text/plain");
ap_rprintf(r, "Type=STATUS-RSP&JVMRoute=%s", nodeinfo.mess.JVMRoute);
- if (isnode_up(r, node->mess.id, node->mess.Type, Load) != OK)
+ if (isnode_up(r, node->mess.id, Load) != OK)
ap_rprintf(r, "&State=NOTOK");
else
ap_rprintf(r, "&State=OK");
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-03-05 11:06:23 UTC (rev 2336)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-03-05 15:03:40 UTC (rev 2337)
@@ -135,67 +135,8 @@
}
#endif
-/* connection cleanup routine */
/* XXX: Should use the proxy_util one. */
-static apr_status_t connection_cleanup(void *theconn)
-{
- proxy_conn_rec *conn = (proxy_conn_rec *)theconn;
- proxy_worker *worker = conn->worker;
-
- /*
- * If the connection pool is NULL the worker
- * cleanup has been run. Just return.
- */
- if (!worker->cp) {
- return APR_SUCCESS;
- }
-
#if APR_HAS_THREADS
- /* Sanity check: Did we already return the pooled connection? */
- if (conn->inreslist) {
- ap_log_perror(APLOG_MARK, APLOG_ERR, 0, conn->pool,
- "proxy: Pooled connection 0x%pp for worker %s has been"
- " already returned to the connection pool.",
- (void *) conn,
- worker->name);
- return APR_SUCCESS;
- }
-#endif
-
- /* determine if the connection need to be closed */
-#if MODULE_MAGIC_NUMBER_MAJOR>=20080722
- if (conn->close)
-#else
- if (conn->close_on_recycle || conn->close)
-#endif
- {
- apr_pool_t *p = conn->pool;
- apr_pool_clear(p);
- conn = apr_pcalloc(p, sizeof(proxy_conn_rec));
- conn->pool = p;
- conn->worker = worker;
-#if AP_MODULE_MAGIC_AT_LEAST(20051115,13)
- apr_pool_create(&(conn->scpool), p);
- apr_pool_tag(conn->scpool, "proxy_conn_scpool");
-#endif
- }
-#if APR_HAS_THREADS
- if (worker->hmax && worker->cp->res) {
- conn->inreslist = 1;
- apr_reslist_release(worker->cp->res, (void *)conn);
- }
- else
-#endif
- {
- worker->cp->conn = conn;
- }
-
- /* Always return the SUCCESS */
- return APR_SUCCESS;
-}
-
-/* XXX: Should use the proxy_util one. */
-#if APR_HAS_THREADS
static apr_status_t conn_pool_cleanup(void *theworker)
{
proxy_worker *worker = (proxy_worker *)theworker;
@@ -1120,10 +1061,9 @@
"ajp_cping_cpong: Done");
return status;
}
-static apr_status_t proxy_cluster_try_pingpong(request_rec *r, proxy_worker *worker, char *scheme)
+static apr_status_t proxy_cluster_try_pingpong(request_rec *r, proxy_worker *worker, char *url, proxy_server_conf *conf)
{
- apr_status_t rv;
- proxy_conn_rec *conn;
+ apr_status_t status;
apr_interval_time_t timeout;
apr_interval_time_t savetimeout;
char savetimeout_set;
@@ -1131,73 +1071,30 @@
#else
proxy_cluster_helper *helperping;
#endif
- /* get the proxy_conn_rec: from ap_proxy_acquire_connection */
-#if APR_HAS_THREADS
- /* prefork() is not "safe" as we have now 2 threads... */
- if (worker->hmax && worker->cp->res) {
- rv = apr_reslist_acquire(worker->cp->res, (void **)&conn);
- }
- else
-#endif
- {
- /* create the new connection if the previous was destroyed */
- rv = APR_SUCCESS;
- if (!worker->cp->conn) {
- /* XXX: What appends is worker->cp->pool is NULL */
- if (worker->cp->pool) {
- connection_constructor((void **)&conn, worker, worker->cp->pool);
- } else
- rv = APR_ENOPOOL;
- }
- else {
- conn = worker->cp->conn;
- worker->cp->conn = NULL;
- }
- }
+ proxy_conn_rec *backend = NULL;
+ char server_portstr[32];
+ char *locurl = url;
+ apr_uri_t *uri;
- if (rv != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "proxy_cluster_try_pingpong: failed acquiring connection");
- if (conn) {
- conn->close = 1;
- ap_proxy_release_connection(scheme, conn, r->server);
+ /* create space for state information */
+ status = ap_proxy_acquire_connection(worker->scheme, &backend, worker, r->server);
+ if (status != OK) {
+ if (backend) {
+ backend->close_on_recycle = 1;
+ ap_proxy_release_connection(worker->scheme, backend, r->server);
}
- return rv;
+ return status;
}
- conn->worker = worker;
- conn->close = 0;
-#if APR_HAS_THREADS
- conn->inreslist = 0;
-#endif
-
- /* Replace ap_proxy_determine_connection XXX: Still not ok */
- if (!conn->hostname) {
- conn->hostname = apr_pstrdup(conn->pool, worker->hostname);
- conn->port = worker->port;
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "proxy_cluster_try_pingpong: connection to %s : %d",
- conn->hostname, conn->port);
-
- if (conn->sock) {
- apr_socket_close(conn->sock);
- conn->sock = NULL;
- }
- if (conn->connection) {
- apr_pool_cleanup_kill(conn->connection->pool, conn, connection_cleanup);
- conn->connection = NULL;
- }
- rv = apr_sockaddr_info_get(&(conn->addr),
- conn->hostname, APR_UNSPEC,
- conn->port, 0,
- conn->pool);
- if (rv != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "proxy_cluster_try_pingpong: can't resolve %s",
- conn->hostname);
- ap_proxy_release_connection(scheme, conn, r->server);
- return rv;
- }
+ /* Step One: Determine Who To Connect To */
+ uri = apr_palloc(r->pool, sizeof(*uri)); /* We don't use it anyway */
+ status = ap_proxy_determine_connection(r->pool, r, conf, worker, backend,
+ uri, &locurl, worker->hostname, worker->port,
+ server_portstr,
+ sizeof(server_portstr));
+ if (status != OK) {
+ ap_proxy_release_connection(worker->scheme, backend, r->server);
+ return status;
}
/* Set the timeout: Note that the default timeout logic in the proxy_util.c is:
@@ -1220,36 +1117,36 @@
worker->timeout_set = 1;
worker->timeout = timeout;
- /* Connect to the backend: Check connected/reuse otherwise create new */
- rv = ap_proxy_connect_backend(scheme, conn, worker, r->server);
+ /* Step Two: Make the Connection */
+ status = ap_proxy_connect_backend(worker->scheme, backend, worker, r->server);
worker->timeout_set = savetimeout_set;
worker->timeout = savetimeout;
- if (rv != APR_SUCCESS) {
+ if (status != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"proxy_cluster_try_pingpong: can't connect to backend");
- ap_proxy_release_connection(scheme, conn, r->server);
- return rv;
+ ap_proxy_release_connection(worker->scheme, backend, r->server);
+ return status;
}
/* XXX: For the moment we support only AJP */
- if (strcasecmp(scheme, "AJP") == 0) {
- rv = ajp_handle_cping_cpong(conn->sock, r, timeout);
- if (rv != APR_SUCCESS) {
+ if (strcasecmp(worker->scheme, "AJP") == 0) {
+ status = ajp_handle_cping_cpong(backend->sock, r, timeout);
+ if (status != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"proxy_cluster_try_pingpong: cping_cpong failed");
- conn->close++;
+ backend->close++;
}
}
- ap_proxy_release_connection(scheme, conn, r->server);
- return rv;
+ ap_proxy_release_connection(worker->scheme, backend, r->server);
+ return status;
}
/*
* Check that we could connect to the node
* id : worker id
* load : load factor from the cluster manager.
*/
-static int proxy_node_isup(request_rec *r, int id, char *scheme, int load)
+static int proxy_node_isup(request_rec *r, int id, int load)
{
void *sconf = r->server->module_config;
proxy_server_conf *conf = (proxy_server_conf *)
@@ -1277,7 +1174,11 @@
/* Try a ping/pong to check the node */
if (load > 0) {
/* Only try usuable nodes */
- rv = proxy_cluster_try_pingpong(r, worker, scheme);
+ char sport[7];
+ char *url;
+ apr_snprintf(sport, sizeof(sport), ":%d", worker->port);
+ url = apr_pstrcat(r->pool, worker->scheme, "ajp://", worker->hostname, sport, "/", NULL);
+ rv = proxy_cluster_try_pingpong(r, worker, url, conf);
if (rv != APR_SUCCESS) {
worker->s->status |= PROXY_WORKER_IN_ERROR;
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
15 years, 10 months
JBoss Native SVN: r2336 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-05 06:06:23 -0500 (Thu, 05 Mar 2009)
New Revision: 2336
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
fix warnings.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-03-05 09:27:30 UTC (rev 2335)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-03-05 11:06:23 UTC (rev 2336)
@@ -48,6 +48,11 @@
#include "balancer.h"
#include "sessionid.h"
+#if APR_HAVE_UNISTD_H
+/* for getpid() */
+#include <unistd.h>
+#endif
+
struct proxy_cluster_helper {
int count_active; /* currently active request using the worker */
#if AP_MODULE_MAGIC_AT_LEAST(20051115,4)
@@ -271,14 +276,7 @@
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
"Created: reusing worker for %s", url);
if ((*worker)->cp->pool == NULL) {
- /* Copied for init_conn_pool in modules/proxy/proxy_util.c */
- apr_pool_t *pool;
- proxy_conn_pool *cp;
- apr_pool_create(&pool, conf->pool);
- apr_pool_tag(pool, "proxy_worker_cp");
- cp = (proxy_conn_pool *)apr_pcalloc(conf->pool, sizeof(proxy_conn_pool));
- cp->pool = pool;
- (*worker)->cp = cp;
+ init_conn_pool(conf->pool, *worker);
}
reuse = 1;
} else {
@@ -604,7 +602,6 @@
{
int *id, size, i;
apr_time_t now;
- int notok = 0;
now = apr_time_now();
@@ -641,7 +638,6 @@
{
int *id, size, i;
apr_time_t now;
- int notok = 0;
now = apr_time_sec(apr_time_now());
15 years, 10 months
JBoss Native SVN: r2335 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-05 04:27:30 -0500 (Thu, 05 Mar 2009)
New Revision: 2335
Modified:
trunk/mod_cluster/test/java/apachectl.bat
Log:
use ping the other doesn't work in a batch.
Modified: trunk/mod_cluster/test/java/apachectl.bat
===================================================================
--- trunk/mod_cluster/test/java/apachectl.bat 2009-03-05 09:00:12 UTC (rev 2334)
+++ trunk/mod_cluster/test/java/apachectl.bat 2009-03-05 09:27:30 UTC (rev 2335)
@@ -28,8 +28,8 @@
"@BASELOC(a)\httpd-2.2\bin\httpd.exe" -k install
REM install will test httpd but using the current user so remove the logs files.
REM wait a little (2 ways)
-choice /c C /D C /t 30
-REM ping -n 31 localhost > NUL
+REM choice /c C /D C /t 30
+ping -n 31 localhost > NUL
dir "@BASELOC(a)\httpd-2.2\logs"
del "@BASELOC(a)\httpd-2.2\logs\access_log"
del "@BASELOC(a)\httpd-2.2\logs\error_log"
15 years, 10 months
JBoss Native SVN: r2334 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-05 04:00:12 -0500 (Thu, 05 Mar 2009)
New Revision: 2334
Modified:
trunk/mod_cluster/test/java/apachectl.bat
Log:
Wait before removing the file (otherwise they are not yet created!!!).
Modified: trunk/mod_cluster/test/java/apachectl.bat
===================================================================
--- trunk/mod_cluster/test/java/apachectl.bat 2009-03-04 17:24:01 UTC (rev 2333)
+++ trunk/mod_cluster/test/java/apachectl.bat 2009-03-05 09:00:12 UTC (rev 2334)
@@ -27,9 +27,12 @@
"@BASELOC(a)\httpd-2.2\bin\httpd.exe" -k install
REM install will test httpd but using the current user so remove the logs files.
+REM wait a little (2 ways)
+choice /c C /D C /t 30
+REM ping -n 31 localhost > NUL
+dir "@BASELOC(a)\httpd-2.2\logs"
del "@BASELOC(a)\httpd-2.2\logs\access_log"
del "@BASELOC(a)\httpd-2.2\logs\error_log"
-dir "@BASELOC(a)\httpd-2.2\logs"
"@BASELOC(a)\httpd-2.2\bin\httpd.exe" -k start
goto end
15 years, 10 months
JBoss Native SVN: r2333 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-04 12:24:01 -0500 (Wed, 04 Mar 2009)
New Revision: 2333
Modified:
trunk/mod_cluster/test/java/apachectl.bat
Log:
add a dir to trace the remove :-(
Modified: trunk/mod_cluster/test/java/apachectl.bat
===================================================================
--- trunk/mod_cluster/test/java/apachectl.bat 2009-03-04 15:35:59 UTC (rev 2332)
+++ trunk/mod_cluster/test/java/apachectl.bat 2009-03-04 17:24:01 UTC (rev 2333)
@@ -29,6 +29,7 @@
REM install will test httpd but using the current user so remove the logs files.
del "@BASELOC(a)\httpd-2.2\logs\access_log"
del "@BASELOC(a)\httpd-2.2\logs\error_log"
+dir "@BASELOC(a)\httpd-2.2\logs"
"@BASELOC(a)\httpd-2.2\bin\httpd.exe" -k start
goto end
15 years, 10 months
JBoss Native SVN: r2332 - trunk/mod_cluster/native/mod_manager.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-04 10:35:59 -0500 (Wed, 04 Mar 2009)
New Revision: 2332
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Our methods are not standard ones so decline standard ones.
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-03-04 08:24:27 UTC (rev 2331)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-03-04 15:35:59 UTC (rev 2332)
@@ -1342,6 +1342,8 @@
r->filename = apr_pstrdup(r->pool, r->uri);
return OK;
}
+ if (r->method_number != M_INVALID)
+ return DECLINED;
if (strcasecmp(r->method, "CONFIG") == 0)
ours = 1;
15 years, 10 months
JBoss Native SVN: r2331 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-04 03:24:27 -0500 (Wed, 04 Mar 2009)
New Revision: 2331
Modified:
trunk/build/unix/buildbin.mod_cluster.sh
Log:
--enable-modules=none doesn't work :-(
Modified: trunk/build/unix/buildbin.mod_cluster.sh
===================================================================
--- trunk/build/unix/buildbin.mod_cluster.sh 2009-03-04 08:08:32 UTC (rev 2330)
+++ trunk/build/unix/buildbin.mod_cluster.sh 2009-03-04 08:24:27 UTC (rev 2331)
@@ -184,7 +184,10 @@
make clean
# For the other MPMs, just build httpd and no optional modules
-mpmbuild worker --enable-modules=none ${add_conf_sys}
+# --enable-modules=none doesn't work... No problem the build takes just more time.
+mpmbuild worker \
+ --enable-mods-shared=all \
+ --enable-modules=none ${add_conf_sys}
if [ $? -ne 0 ]; then
echo "mpmbuild worker failed"
exit 1
15 years, 10 months
JBoss Native SVN: r2330 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-04 03:08:32 -0500 (Wed, 04 Mar 2009)
New Revision: 2330
Modified:
trunk/mod_cluster/test/java/apachectl.bat
Log:
install will test httpd but using the current user so remove the logs files.
in my tests the prevent the service to start:
rwx------ 1 hudson None 65 Mar 3 21:20 error_log
instead
-rwx------ 1 Administrators None 749 Mar 4 03:02 error_log
Modified: trunk/mod_cluster/test/java/apachectl.bat
===================================================================
--- trunk/mod_cluster/test/java/apachectl.bat 2009-03-03 20:50:22 UTC (rev 2329)
+++ trunk/mod_cluster/test/java/apachectl.bat 2009-03-04 08:08:32 UTC (rev 2330)
@@ -26,6 +26,9 @@
@if "%1" == "stop" goto stop
"@BASELOC(a)\httpd-2.2\bin\httpd.exe" -k install
+REM install will test httpd but using the current user so remove the logs files.
+del "@BASELOC(a)\httpd-2.2\logs\access_log"
+del "@BASELOC(a)\httpd-2.2\logs\error_log"
"@BASELOC(a)\httpd-2.2\bin\httpd.exe" -k start
goto end
15 years, 10 months
JBoss Native SVN: r2329 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-03 15:50:22 -0500 (Tue, 03 Mar 2009)
New Revision: 2329
Modified:
trunk/build/unix/buildbin.mod_cluster.sh
Log:
Use worker as default httpd.
Modified: trunk/build/unix/buildbin.mod_cluster.sh
===================================================================
--- trunk/build/unix/buildbin.mod_cluster.sh 2009-03-03 17:40:21 UTC (rev 2328)
+++ trunk/build/unix/buildbin.mod_cluster.sh 2009-03-03 20:50:22 UTC (rev 2329)
@@ -190,9 +190,12 @@
exit 1
fi
-# Install it
-#install -m 755 worker/httpd ${RPM_BUILD_ROOT}/${_sbindir}/httpd.worker
-install -m 755 httpd ${RPM_BUILD_ROOT}/${_sbindir}/httpd.worker
+# Install it (and more the prefork one).
+mkdir -p $RPM_BUILD_ROOT/mod_cluster_worker
+make DESTDIR=$RPM_BUILD_ROOT/mod_cluster_worker install
+mv ${RPM_BUILD_ROOT}/${_sbindir}/httpd ${RPM_BUILD_ROOT}/${_sbindir}/httpd.prefork
+cp ${RPM_BUILD_ROOT}/mod_cluster_worker/${_sbindir}/httpd ${RPM_BUILD_ROOT}/${_sbindir}/httpd
+rm -rf ${RPM_BUILD_ROOT}/mod_cluster_worker
# Add the needed openssl stuff.
current_loc=`pwd`
15 years, 10 months
JBoss Native SVN: r2328 - trunk/mod_cluster/test/java/org/jboss/mod_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-03 12:40:21 -0500 (Tue, 03 Mar 2009)
New Revision: 2328
Modified:
trunk/mod_cluster/test/java/org/jboss/mod_cluster/Client.java
Log:
Add an argument to have variable loads.
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/Client.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/Client.java 2009-03-03 09:25:30 UTC (rev 2327)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/Client.java 2009-03-03 17:40:21 UTC (rev 2328)
@@ -50,6 +50,7 @@
private int nbtest = 10;
private int delay = 1000;
+ private int wait = 100;
private Random rand = null;
private boolean checkcookie = true;
private boolean checknode = true;
@@ -67,21 +68,22 @@
*
* @param args command line arguments
* Argument 0 is a URL to a web server
- * Argument 1 is the command to execute.
+ * Argument 1 is the max time to wait between requests (in 10 milliseconds units)
*
*/
public static void main(String[] args) throws Exception
{
- if (args.length != 1)
+ if (args.length != 2)
{
System.err.println("missing command line arguments");
System.exit(1);
}
- Client client[] = new Client[200];
+ Client client[] = new Client[500];
for (int i=0; i<client.length; i++) {
client[i] = new Client();
- client[i].runit(args[0], 100, true);
+ client[i].runit(args[0], 100000, true, Integer.parseInt(args[1]));
}
+ System.out.println("making \"second\" requests");
for (int i=0; i<client.length; i++) {
client[i].start();
}
@@ -143,6 +145,11 @@
return runit();
}
+ public int runit(String URL, int nbtest, boolean checkcookie, int wait) throws Exception
+ {
+ this.wait = wait;
+ return runit(URL, nbtest, checkcookie);
+ }
public int runit() throws Exception
{
@@ -291,7 +298,7 @@
success = false;
return;
}
- sleep((int)(rand.nextInt(100) * 10));
+ sleep((int)(rand.nextInt(wait) * 10));
} catch (InterruptedException e) {
e.printStackTrace();
success = false;
15 years, 10 months