]> code.delx.au - gnu-emacs/commitdiff
Change test for ControlPath in order to avoid DNS timeouts.
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 17 Mar 2015 09:18:10 +0000 (10:18 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 17 Mar 2015 09:18:10 +0000 (10:18 +0100)
Fixes: debbugs:20015
* net/tramp-sh.el (tramp-ssh-controlmaster-options): Change test
for ControlPath in order to avoid DNS timeouts.

lisp/ChangeLog
lisp/net/tramp-sh.el

index cbd1bce25e843c980e89f2bc148d7b4e77f7686a..96478223d495606d2f5af4d13499853772257938 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-17  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp-sh.el (tramp-ssh-controlmaster-options): Change test
+       for ControlPath in order to avoid DNS timeouts.  (Bug#20015)
+
 2015-03-16  Alan Mackenzie  <acm@muc.de>
 
        Edebug: Allow "S" to work during trace mode.  Fixes debbugs #20074.
index 73ad8c7e4ef2dba306a499dcc0f746d7e2fb4215..b6c47bcb7bb93f750343684b4b54f22fd3525c9f 100644 (file)
@@ -4565,7 +4565,7 @@ Gateway hops are already opened."
 
     ;; In case the host name is not used for the remote shell
     ;; command, the user could be misguided by applying a random
-    ;; hostname.
+    ;; host name.
     (let* ((v (car target-alist))
           (method (tramp-file-name-method v))
           (host (tramp-file-name-host v)))
@@ -4611,9 +4611,13 @@ Gateway hops are already opened."
                (setq tramp-ssh-controlmaster-options "-o ControlMaster=auto")))
            (unless (zerop (length tramp-ssh-controlmaster-options))
              (with-temp-buffer
+               ;; When we use a non-existing host name, we could run
+               ;; into DNS timeouts.  So we use "localhost" with an
+               ;; improper port, expecting nobody runs sshd on the
+               ;; telnet port.
                (tramp-call-process
                 vec "ssh" nil t nil
-                "-o" "ControlPath=%C" "host.does.not.exist")
+                "-p" "23" "-o" "ControlPath=%C" "localhost")
                (goto-char (point-min))
                (setq tramp-ssh-controlmaster-options
                      (if (search-forward-regexp "unknown.+key" nil t)