Author: tridge
Date: 2007-05-15 05:42:16 +0000 (Tue, 15 May 2007)
New Revision: 22881

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22881

Log:
show number of connected clients
Modified:
   branches/SAMBA_4_0/source/torture/raw/lockbench.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/lockbench.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/lockbench.c   2007-05-15 05:38:33 UTC 
(rev 22880)
+++ branches/SAMBA_4_0/source/torture/raw/lockbench.c   2007-05-15 05:42:16 UTC 
(rev 22881)
@@ -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 @@
        }
        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 @@
        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 @@
        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 @@
                                                      cli->tree->device);
        }
 
+       num_connected = i;
+
        if (!torture_setup_dir(cli, BASEDIR)) {
                goto failed;
        }

Reply via email to