: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)
+
\f
;;;; ------------------------------------------------------------
;;;; Hash table support.
;; 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))