Commit 525371f1 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(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.
parent b632fa48
......@@ -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))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment