summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-12-10 15:46:41 -0800
committerJeremy Allison <jra@samba.org>2010-12-10 15:46:41 -0800
commit2ac579ca76452c58022e8b9e41d5168dd25fe3b0 (patch)
treeac83a978995be4d66e700409ef59eeed78637958 /source3/param
parent533ba5a919b08a3eb040af7ea980163661b642c7 (diff)
downloadsamba-2ac579ca76452c58022e8b9e41d5168dd25fe3b0.tar.gz
samba-2ac579ca76452c58022e8b9e41d5168dd25fe3b0.tar.bz2
samba-2ac579ca76452c58022e8b9e41d5168dd25fe3b0.zip
Add a SMB2 crediting algorithm, by default the same as Windows. Defaults to 128 credits.
Jeremy.
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 807d074082..ced8223833 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -380,6 +380,7 @@ struct global {
int ismb2_max_read;
int ismb2_max_write;
int ismb2_max_trans;
+ int ismb2_max_credits;
char *ncalrpc_dir;
};
@@ -2635,6 +2636,15 @@ static struct parm_struct parm_table[] = {
.enum_list = NULL,
.flags = FLAG_ADVANCED,
},
+ {
+ .label = "smb2 max credits",
+ .type = P_INTEGER,
+ .p_class = P_GLOBAL,
+ .ptr = &Globals.ismb2_max_credits,
+ .special = NULL,
+ .enum_list = NULL,
+ .flags = FLAG_ADVANCED,
+ },
{N_("Printing Options"), P_SEP, P_SEPARATOR},
@@ -5404,9 +5414,10 @@ static void init_globals(bool reinit_globals)
Globals.bMapUntrustedToDomain = false;
Globals.bMulticastDnsRegister = true;
- Globals.ismb2_max_read = 1024*1024;
- Globals.ismb2_max_write = 1024*1024;
- Globals.ismb2_max_trans = 1024*1024;
+ Globals.ismb2_max_read = DEFAULT_SMB2_MAX_READ;
+ Globals.ismb2_max_write = DEFAULT_SMB2_MAX_WRITE;
+ Globals.ismb2_max_trans = DEFAULT_SMB2_MAX_TRANSACT;
+ Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
string_set(&Globals.ncalrpc_dir, get_dyn_NCALRPCDIR());
@@ -5777,7 +5788,13 @@ FN_GLOBAL_INTEGER(lp_config_backend, &Globals.ConfigBackend)
FN_GLOBAL_INTEGER(lp_smb2_max_read, &Globals.ismb2_max_read)
FN_GLOBAL_INTEGER(lp_smb2_max_write, &Globals.ismb2_max_write)
FN_GLOBAL_INTEGER(lp_smb2_max_trans, &Globals.ismb2_max_trans)
-
+int lp_smb2_max_credits(void)
+{
+ if (Globals.ismb2_max_credits == 0) {
+ Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
+ }
+ return Globals.ismb2_max_credits;
+}
FN_LOCAL_STRING(lp_preexec, szPreExec)
FN_LOCAL_STRING(lp_postexec, szPostExec)
FN_LOCAL_STRING(lp_rootpreexec, szRootPreExec)