torture/raw: Fix warnings in lockbench/openbench.
authorjelmer <jelmer@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Thu, 3 Jan 2008 17:21:50 +0000 (17:21 +0000)
committerjelmer <jelmer@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Thu, 3 Jan 2008 17:21:50 +0000 (17:21 +0000)
I'm surprised this didn't cause any breakages. We should probably run (a subset of) RAW-LOCKBENCH + RAW-OPENBENCH in make test to make sure they don't regress.

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@26650 0c0555d6-39d7-0310-84fc-f1cc0bd64818

source/torture/raw/lockbench.c
source/torture/raw/openbench.c

index 28392880d75e1d29d589e77318c5c6699f077e42..ea570e5bf50458f960adbcc3ca3d1501d39597fa 100644 (file)
@@ -59,7 +59,7 @@ struct benchlock_state {
        struct timed_event *te;
 
        /* these are used for reconnections */
-       int dest_port;
+       const char **dest_ports;
        const char *dest_host;
        const char *called_name;
        const char *service_type;
@@ -186,7 +186,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
        }
 
        io->in.dest_host    = state->dest_host;
-       io->in.dest_ports   = state->dest_port;
+       io->in.dest_ports   = state->dest_ports;
        io->in.called_name  = state->called_name;
        io->in.service      = share;
        io->in.service_type = state->service_type;
@@ -345,7 +345,12 @@ bool torture_bench_lock(struct torture_context *torture)
                state[i].tree = cli->tree;
                state[i].dest_host = talloc_strdup(state[i].mem_ctx, 
                                                   cli->tree->session->transport->socket->hostname);
-               state[i].dest_port = cli->tree->session->transport->socket->port;
+               state[i].dest_ports = talloc_array(state[i].mem_ctx, 
+                                                  const char *, 2);
+               state[i].dest_ports[0] = talloc_asprintf(state[i].dest_ports, 
+                                                        "%u", 
+                                                        cli->tree->session->transport->socket->port);
+               state[i].dest_ports[1] = NULL;
                state[i].called_name  = talloc_strdup(state[i].mem_ctx,
                                                      cli->tree->session->transport->called.name);
                state[i].service_type = talloc_strdup(state[i].mem_ctx,
index 4b6c76488f77e954cecb94d28fc23b983e9f5e39..0582905816115acba1780d49a3e62f45757f01a2 100644 (file)
@@ -62,7 +62,7 @@ struct benchopen_state {
        struct timed_event *te;
 
        /* these are used for reconnections */
-       int dest_port;
+       const char **dest_ports;
        const char *dest_host;
        const char *called_name;
        const char *service_type;
@@ -124,7 +124,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
        }
 
        io->in.dest_host    = state->dest_host;
-       io->in.dest_ports   = state->dest_port;
+       io->in.dest_ports   = state->dest_ports;
        io->in.called_name  = state->called_name;
        io->in.service      = share;
        io->in.service_type = state->service_type;
@@ -379,7 +379,11 @@ bool torture_bench_open(struct torture_context *torture)
                state[i].tree = state[i].cli->tree;
                state[i].dest_host = talloc_strdup(state[i].mem_ctx, 
                                                   state[i].cli->tree->session->transport->socket->hostname);
-               state[i].dest_port = state[i].cli->tree->session->transport->socket->port;
+               state[i].dest_ports = talloc_array(state[i].mem_ctx, 
+                                                  const char *, 2);
+               state[i].dest_ports[0] = talloc_asprintf(state[i].dest_ports, 
+                                                        "%u", state[i].cli->tree->session->transport->socket->port);
+               state[i].dest_ports[1] = NULL;
                state[i].called_name  = talloc_strdup(state[i].mem_ctx,
                                                      state[i].cli->tree->session->transport->called.name);
                state[i].service_type = talloc_strdup(state[i].mem_ctx,