Changeset 11823
- Timestamp:
- 08/15/2009 12:01:04 PM (15 years ago)
- Location:
- trunk/wp-admin/includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-filesystem-ftpext.php
r11821 r11823 17 17 class WP_Filesystem_FTPext extends WP_Filesystem_Base { 18 18 var $link; 19 var $timeout = 5;20 19 var $errors = null; 21 20 var $options = array(); … … 34 33 35 34 // Set defaults: 35 //This Class uses the timeout on a per-connection basis, Others use it on a per-action basis. 36 37 if ( ! defined('FS_TIMEOUT') ) 38 define('FS_TIMEOUT', 240); 39 36 40 if ( empty($opt['port']) ) 37 41 $this->options['port'] = 21; … … 65 69 function connect() { 66 70 if ( isset($this->options['ssl']) && $this->options['ssl'] && function_exists('ftp_ssl_connect') ) 67 $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], $this->timeout);68 else 69 $this->link = @ftp_connect($this->options['hostname'], $this->options['port'], $this->timeout);71 $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT); 72 else 73 $this->link = @ftp_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT); 70 74 71 75 if ( ! $this->link ) { … … 81 85 //Set the Connection to use Passive FTP 82 86 @ftp_pasv( $this->link, true ); 87 if ( @ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FTP_TIMEOUT ) 88 @ftp_set_option($this->link, FTP_TIMEOUT_SEC, FTP_TIMEOUT); 83 89 84 90 return true; -
trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r11005 r11823 17 17 class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { 18 18 var $ftp = false; 19 var $timeout = 5;20 19 var $errors = null; 21 20 var $options = array(); … … 62 61 return false; 63 62 64 //$this->ftp->Verbose = true;63 $this->ftp->setTimeout(FS_CONNECT_TIMEOUT); 65 64 66 65 if ( ! $this->ftp->SetServer($this->options['hostname'], $this->options['port']) ) { … … 68 67 return false; 69 68 } 69 70 70 if ( ! $this->ftp->connect() ) { 71 71 $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); … … 80 80 $this->ftp->SetType(FTP_AUTOASCII); 81 81 $this->ftp->Passive(true); 82 $this->ftp->setTimeout(FS_TIMEOUT); 82 83 return true; 83 84 } -
trunk/wp-admin/includes/class-wp-filesystem-ssh2.php
r11818 r11823 46 46 var $sftp_link = false; 47 47 var $keys = false; 48 /*49 * This is the timeout value for ssh results.50 * Slower servers might need this incressed, but this number otherwise should not change.51 *52 * @parm $timeout int53 *54 */55 var $timeout = 15;56 48 var $errors = array(); 57 49 var $options = array(); … … 149 141 } else { 150 142 stream_set_blocking( $stream, true ); 151 stream_set_timeout( $stream, $this->timeout);143 stream_set_timeout( $stream, FS_TIMEOUT ); 152 144 $data = stream_get_contents( $stream ); 153 145 fclose( $stream ); -
trunk/wp-admin/includes/file.php
r11819 r11823 606 606 $wp_filesystem = new $method($args); 607 607 608 //Define the timeouts for the connections. Only available after the construct is called to allow for per-transport overriding of the default. 609 if ( ! defined('FS_CONNECT_TIMEOUT') ) 610 define('FS_CONNECT_TIMEOUT', 30); 611 if ( ! defined('FS_TIMEOUT') ) 612 define('FS_TIMEOUT', 30); 613 608 614 if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() ) 609 615 return false;
Note: See TracChangeset
for help on using the changeset viewer.