summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-05-15 05:42:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:52:28 -0500
commit3173a3cee6e7b85e0822e21306c5612467dfd5e2 (patch)
tree57ad144ee6a93fa4b2a2f1765c67829de6e34371 /source4/torture
parenta4e571b58969fc75c40152c39b7d4e0fa3f6ad3f (diff)
downloadsamba-3173a3cee6e7b85e0822e21306c5612467dfd5e2.tar.gz
samba-3173a3cee6e7b85e0822e21306c5612467dfd5e2.tar.bz2
samba-3173a3cee6e7b85e0822e21306c5612467dfd5e2.zip
r22881: show number of connected clients
(This used to be commit 42f6c5106ea4d0e35f88e0c9523cbd13206fecb5)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/lockbench.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c
index d399a4f3f2..d603878450 100644
--- a/source4/torture/raw/lockbench.c
+++ b/source4/torture/raw/lockbench.c
@@ -44,6 +44,7 @@
static int nprocs;
static int lock_failed;
+static int num_connected;
struct benchlock_state {
struct event_context *ev;
@@ -115,6 +116,11 @@ static void reopen_file(struct event_context *ev, struct timed_event *te,
}
state->req->async.private = state;
state->req->async.fn = lock_completion;
+
+ num_connected++;
+
+ DEBUG(0,("reconnect to %s finished (%u connected)\n", state->dest_host,
+ num_connected));
}
/*
@@ -168,8 +174,6 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
io->in.fallback_to_anonymous = False;
io->in.workgroup = lp_workgroup();
- DEBUG(0,("reopening connection to //%s/%s\n", host, share));
-
/* kill off the remnants of the old connection */
talloc_free(state->tree);
state->tree = NULL;
@@ -195,6 +199,10 @@ static void lock_completion(struct smbcli_request *req)
state->req = NULL;
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)) {
+ talloc_free(state->tree);
+ state->tree = NULL;
+ num_connected--;
+ DEBUG(0,("reopening connection to %s\n", state->dest_host));
event_add_timed(state->ev, state->mem_ctx,
timeval_current_ofs(1,0),
reopen_connection, state);
@@ -247,6 +255,8 @@ BOOL torture_bench_lock(struct torture_context *torture)
cli->tree->device);
}
+ num_connected = i;
+
if (!torture_setup_dir(cli, BASEDIR)) {
goto failed;
}