summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/l2test.c28
-rw-r--r--test/rctest.c30
2 files changed, 32 insertions, 26 deletions
diff --git a/test/l2test.c b/test/l2test.c
index 5c34b39e..f8572067 100644
--- a/test/l2test.c
+++ b/test/l2test.c
@@ -655,20 +655,24 @@ static void connect_mode(char *svr)
close(sk);
}
-static void multi_connect_mode(char *svr)
+static void multi_connect_mode(int argc, char *argv[])
{
+ int i, n, sk;
+
while (1) {
- int i, s;
- for (i = 0; i < 10; i++) {
- if (fork()) continue;
-
- /* Child */
- s = do_connect(svr);
- usleep(500);
- close(s);
- exit(0);
+ for (n = 0; n < argc; n++) {
+ for (i = 0; i < count; i++) {
+ if (fork())
+ continue;
+
+ /* Child */
+ sk = do_connect(argv[n]);
+ usleep(500);
+ close(sk);
+ exit(0);
+ }
}
- sleep(2);
+ sleep(4);
}
}
@@ -894,7 +898,7 @@ int main(int argc, char *argv[])
break;
case MULTY:
- multi_connect_mode(argv[optind]);
+ multi_connect_mode(argc - optind, argv + optind);
break;
case CONNECT:
diff --git a/test/rctest.c b/test/rctest.c
index 17d7c5d3..8de23f78 100644
--- a/test/rctest.c
+++ b/test/rctest.c
@@ -390,22 +390,24 @@ static void reconnect_mode(char *svr)
}
}
-static void multi_connect_mode(char *svr)
+static void multi_connect_mode(int argc, char *argv[])
{
- while (1) {
- int i, sk;
-
- for (i = 0; i < 10; i++) {
- if (fork()) continue;
+ int i, n, sk;
- /* Child */
- sk = do_connect(svr);
- usleep(500);
- close(sk);
- exit(0);
+ while (1) {
+ for (n = 0; n < argc; n++) {
+ for (i = 0; i < count; i++) {
+ if (fork())
+ continue;
+
+ /* Child */
+ sk = do_connect(argv[n]);
+ usleep(500);
+ close(sk);
+ exit(0);
+ }
}
-
- sleep(2);
+ sleep(4);
}
}
@@ -589,7 +591,7 @@ int main(int argc, char *argv[])
break;
case MULTY:
- multi_connect_mode(argv[optind]);
+ multi_connect_mode(argc - optind, argv + optind);
break;
case CONNECT: