# HG changeset patch # User Gerd Moellmann # Date 953341606 0 # Node ID b65709e0ea05c39a2dc1e2eafc15c083b78a6f9a # Parent aa79cfcecd7396932ff0291640f0708f73ba68cb (ange-ftp-try-passive-mode): New user-option. (ange-ftp-get-process): If ange-ftp-try-passive-mode is set, try to use poassive ftp mode. diff -r aa79cfcecd73 -r b65709e0ea05 lisp/ange-ftp.el --- a/lisp/ange-ftp.el Sat Mar 18 01:04:28 2000 +0000 +++ b/lisp/ange-ftp.el Sat Mar 18 01:06:46 2000 +0000 @@ -928,6 +928,14 @@ :group 'ange-ftp :type '(choice (const :tag "Suppress" 0) (const :tag "Allow" 1))) + +(defcustom ange-ftp-try-passive-mode nil + "It t, try to use passive mode in ftp, if the client program +supports the `passive' command." + :group 'ange-ftp + :type 'boolean + :version 21.1) + ;;;; ------------------------------------------------------------ ;;;; Hash table support. @@ -2089,6 +2097,14 @@ ;; Guess at the host type. (ange-ftp-guess-host-type host user) + ;; Try to use passive mode if asked to. + (when ange-ftp-try-passive-mode + (let ((answer (cdr (ange-ftp-raw-send-cmd + proc "passive" "Trying passive mode..." nil)))) + (if (string-match "\\?\\|refused" answer) + (message "Trying passive mode...ok") + (message "Trying passive mode...failed")))) + ;; Run any user-specified hooks. Note that proc, host and user are ;; dynamically bound at this point. (run-hooks 'ange-ftp-process-startup-hook))