changeset 28191:b65709e0ea05

(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.
author Gerd Moellmann <gerd@gnu.org>
date Sat, 18 Mar 2000 01:06:46 +0000
parents aa79cfcecd73
children 6d1e3113c08e
files lisp/ange-ftp.el
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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))