File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
apps/files_external/lib/Lib Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ public function __construct(IL10N $l, Password $legacyAuth) {
5353 (new DefinitionParameter ('show_hidden ' , $ l ->t ('Show hidden files ' )))
5454 ->setType (DefinitionParameter::VALUE_BOOLEAN )
5555 ->setFlag (DefinitionParameter::FLAG_OPTIONAL ),
56+ (new DefinitionParameter ('timeout ' , $ l ->t ('Timeout ' )))
57+ ->setType (DefinitionParameter::VALUE_HIDDEN )
5658 ])
5759 ->addAuthScheme (AuthMechanism::SCHEME_PASSWORD )
5860 ->addAuthScheme (AuthMechanism::SCHEME_SMB )
Original file line number Diff line number Diff line change 4444use Icewind \SMB \Exception \TimedOutException ;
4545use Icewind \SMB \IFileInfo ;
4646use Icewind \SMB \Native \NativeServer ;
47+ use Icewind \SMB \Options ;
4748use Icewind \SMB \ServerFactory ;
4849use Icewind \SMB \System ;
4950use Icewind \Streams \CallbackWrapper ;
@@ -106,7 +107,14 @@ public function __construct($params) {
106107 $ this ->logger = \OC ::$ server ->getLogger ();
107108 }
108109
109- $ serverFactory = new ServerFactory ();
110+ $ options = new Options ();
111+ if (isset ($ params ['timeout ' ])) {
112+ $ timeout = (int )$ params ['timeout ' ];
113+ if ($ timeout > 0 ) {
114+ $ options ->setTimeout ($ timeout );
115+ }
116+ }
117+ $ serverFactory = new ServerFactory ($ options );
110118 $ this ->server = $ serverFactory ->createServer ($ params ['host ' ], $ auth );
111119 $ this ->share = $ this ->server ->getShare (trim ($ params ['share ' ], '/ ' ));
112120
You can’t perform that action at this time.
0 commit comments