From 525371f1384c36e752da713c8c9dfe6f9c290b7f Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Sat, 18 Mar 2000 01:06:46 +0000 Subject: [PATCH] (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. --- lisp/ange-ftp.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lisp/ange-ftp.el b/lisp/ange-ftp.el index fb0b03b52e0..695a44fcaa5 100644 --- a/lisp/ange-ftp.el +++ b/lisp/ange-ftp.el @@ -928,6 +928,14 @@ Don't use any other value." :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 @@ Create a new process if needed." ;; 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)) -- 2.39.5