Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Add param for smb option
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Dec 11, 2017
1 parent 3de41e5 commit 829dedc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions core/src/plugins/access.smb/SMBAccessDriver.php
Expand Up @@ -62,6 +62,9 @@ protected function loadExternalWrapper(){
if(!empty($this->pluginConf['SMB_PATH_TMP']) && !defined('SMB_PATH_TMP')){
define ('SMB4PHP_SMBTMP', $this->pluginConf["SMB_PATH_TMP"]);
}
if(!empty($this->pluginConf['SMB_DISABLE_BUFFER'])){
define ('SMB_DISABLE_BUFFER', true);
}
require_once($this->getBaseDir()."/smb.php");
}

Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/access.smb/manifest.xml
Expand Up @@ -16,6 +16,7 @@
<global_param name="SMBCLIENT" type="string" label="CONF_MESSAGE[Smbclient]" description="CONF_MESSAGE[Path to smbclient executable, considered to be in the path by default.]" mandatory="true" default="smbclient"/>
<global_param name="SMB_PATH_TMP" type="string" label="CONF_MESSAGE[Path Tmp]" description="CONF_MESSAGE[OS Path Temporary if not the default one]" mandatory="true" default="/tmp"/>
<global_param name="SMB_ENABLE_ZIP" type="boolean" label="CONF_MESSAGE[Enable Zip]" description="CONF_MESSAGE[Enable zip creation for repositories using Samba access. Make sure that you are using a very fast network, otherwise it will be very long!]" mandatory="false" default="false"/>
<global_param name="SMB_DISABLE_BUFFER" type="boolean" label="CONF_MESSAGE[Disable smb buffer option]" description="CONF_MESSAGE[The setting socket options SO_RCVBUF=8192 sometimes can seriously degrade performance]" mandatory="false" default="false"/>
<global_param group="MIXIN_MESSAGE[Metadata and indexation]" name="DEFAULT_METASOURCES" type="string" label="MIXIN_MESSAGE[Default Metasources]" description="MIXIN_MESSAGE[Comma separated list of metastore and meta plugins, that will be automatically applied to all repositories created with this driver]" mandatory="false" default="metastore.serial,meta.filehasher,index.lucene"/>
</server_settings>
<registry_contributions>
Expand Down
8 changes: 6 additions & 2 deletions core/src/plugins/access.smb/smb.php
Expand Up @@ -37,8 +37,12 @@
if (!defined('SMB4PHP_SMBTMP')) {
define ('SMB4PHP_SMBTMP', '/tmp');
}

define ('SMB4PHP_SMBOPTIONS', 'TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192');
if (defined('SMB_DISABLE_BUFFER')){
define ('SMB4PHP_SMBOPTIONS', 'TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE');
}
else {
define ('SMB4PHP_SMBOPTIONS', 'TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192');
}
define ('SMB4PHP_AUTHMODE', 'arg'); # set to 'env' to use USER enviroment variable

###################################################################
Expand Down

0 comments on commit 829dedc

Please sign in to comment.