Add constants for ftp connections timeouts, props dd32, see #10522

git-svn-id: https://develop.svn.wordpress.org/trunk@11823 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-08-15 12:01:04 +00:00
parent 5e8dbc10cd
commit 10cd9df0ae
4 changed files with 19 additions and 14 deletions
@@ -16,7 +16,6 @@
*/
class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
var $ftp = false;
var $timeout = 5;
var $errors = null;
var $options = array();
@@ -61,12 +60,13 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
if ( ! $this->ftp )
return false;
//$this->ftp->Verbose = true;
$this->ftp->setTimeout(FS_CONNECT_TIMEOUT);
if ( ! $this->ftp->SetServer($this->options['hostname'], $this->options['port']) ) {
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
return false;
}
if ( ! $this->ftp->connect() ) {
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
return false;
@@ -79,6 +79,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
$this->ftp->SetType(FTP_AUTOASCII);
$this->ftp->Passive(true);
$this->ftp->setTimeout(FS_TIMEOUT);
return true;
}