summaryrefslogtreecommitdiff
path: root/source4/client/cifsdd.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-03 17:22:12 -0600
committerStefan Metzmacher <metze@samba.org>2008-01-03 12:33:36 -0600
commitdcc282590b34537fc1ead61c3300172528273b44 (patch)
tree9890dda1e9f3001c23828caf1e8da1afbc3feb45 /source4/client/cifsdd.c
parentdc8ccffed40ed5a5978961c632a9e28331a0fd4f (diff)
downloadsamba-dcc282590b34537fc1ead61c3300172528273b44.tar.gz
samba-dcc282590b34537fc1ead61c3300172528273b44.tar.bz2
samba-dcc282590b34537fc1ead61c3300172528273b44.zip
r26654: libcli/smb_composite: Rather than specifying each of the gazillion options for SMB individually, just specify the smbcli_options struct.
(This used to be commit 8a97886e24a4b969aa91409c06f423b71a45f6eb)
Diffstat (limited to 'source4/client/cifsdd.c')
-rw-r--r--source4/client/cifsdd.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c
index 8749a82573..8e25dab927 100644
--- a/source4/client/cifsdd.c
+++ b/source4/client/cifsdd.c
@@ -23,6 +23,7 @@
#include "auth/gensec/gensec.h"
#include "lib/cmdline/popt_common.h"
#include "libcli/resolve/resolve.h"
+#include "libcli/raw/libcliraw.h"
#include "cifsdd.h"
#include "param/param.h"
@@ -353,7 +354,8 @@ static void print_transfer_stats(void)
}
static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx,
- const char * which, const char **ports)
+ const char * which, const char **ports,
+ struct smbcli_options *smb_options)
{
int options = 0;
const char * path = NULL;
@@ -374,12 +376,14 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx,
if (strcmp(which, "if") == 0) {
path = check_arg_pathname("if");
handle = dd_open_path(resolve_ctx, path, ports,
- check_arg_numeric("ibs"), options);
+ check_arg_numeric("ibs"), options,
+ smb_options);
} else if (strcmp(which, "of") == 0) {
options |= DD_WRITE;
path = check_arg_pathname("of");
handle = dd_open_path(resolve_ctx, path, ports,
- check_arg_numeric("obs"), options);
+ check_arg_numeric("obs"), options,
+ smb_options);
} else {
SMB_ASSERT(0);
return(NULL);
@@ -392,14 +396,6 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx,
return(handle);
}
-static void set_max_xmit(struct loadparm_context *lp_ctx, uint64_t iomax)
-{
- char buf[64];
-
- snprintf(buf, sizeof(buf), "%llu", (unsigned long long)iomax);
- lp_set_cmdline(lp_ctx, "max xmit", buf);
-}
-
static int copy_files(struct loadparm_context *lp_ctx)
{
uint8_t * iobuf; /* IO buffer. */
@@ -413,10 +409,14 @@ static int copy_files(struct loadparm_context *lp_ctx)
struct dd_iohandle * ifile;
struct dd_iohandle * ofile;
+ struct smbcli_options options;
+
ibs = check_arg_numeric("ibs");
obs = check_arg_numeric("obs");
count = check_arg_numeric("count");
+ lp_smbcli_options(lp_ctx, &options);
+
/* Allocate IO buffer. We need more than the max IO size because we
* could accumulate a remainder if ibs and obs don't match.
*/
@@ -428,18 +428,18 @@ static int copy_files(struct loadparm_context *lp_ctx)
return(EOM_EXIT_CODE);
}
- set_max_xmit(lp_ctx, MAX(ibs, obs));
+ options.max_xmit = MAX(ibs, obs);
DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n",
- (unsigned long long)iomax, lp_max_xmit(lp_ctx)));
+ (unsigned long long)iomax, options.max_xmit));
if (!(ifile = open_file(lp_resolve_context(lp_ctx), "if",
- lp_smb_ports(lp_ctx)))) {
+ lp_smb_ports(lp_ctx), &options))) {
return(FILESYS_EXIT_CODE);
}
if (!(ofile = open_file(lp_resolve_context(lp_ctx), "of",
- lp_smb_ports(lp_ctx)))) {
+ lp_smb_ports(lp_ctx), &options))) {
return(FILESYS_EXIT_CODE);
}
@@ -447,7 +447,7 @@ static int copy_files(struct loadparm_context *lp_ctx)
ifile->io_seek(ifile, check_arg_numeric("skip") * ibs);
ofile->io_seek(ofile, check_arg_numeric("seek") * obs);
- DEBUG(4, ("max xmit was negotiated to be %d\n", lp_max_xmit(lp_ctx)));
+ DEBUG(4, ("max xmit was negotiated to be %d\n", options.max_xmit));
for (data_size = 0;;) {