Index: class-wp-filesystem-ftpext.php
===================================================================
--- class-wp-filesystem-ftpext.php	(Revision 11754)
+++ class-wp-filesystem-ftpext.php	(Arbeitskopie)
@@ -16,7 +16,7 @@
  */
 class WP_Filesystem_FTPext extends WP_Filesystem_Base {
 	var $link;
-	var $timeout = 5;
+	var $timeout = 30;
 	var $errors = null;
 	var $options = array();
 
@@ -43,6 +43,9 @@
 		else
 			$this->options['hostname'] = $opt['hostname'];
 
+		if ( isset($opt['connect_timeout']) && ! empty($opt['connect_timeout']) && 0 < intval($opt['connect_timeout']))
+			$this->timeout = intval($opt['connect_timeout']);
+
 		if ( isset($opt['base']) && ! empty($opt['base']) )
 			$this->wp_base = $opt['base'];
 
@@ -73,8 +76,14 @@
 			return false;
 		}
 
+		$start_time = array_sum(explode(chr(32), microtime())); // this should be PHP 4 save
 		if ( ! @ftp_login($this->link,$this->options['username'], $this->options['password']) ) {
-			$this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username']));
+			$finish_time = array_sum(explode(chr(32), microtime()));
+			if  ( ($finish_time - $start_time) > $this->timeout ) {
+				$this->errors->add('auth', __('FTP login process timed out'));
+			} else {
+				$this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username']));
+			}
 			return false;
 		}
 
