emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v
Date: Sun, 15 Jun 2008 16:57:05 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       08/06/15 16:57:04

Index: tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -b -r1.201 -r1.202
--- tramp.el    15 Jun 2008 13:36:30 -0000      1.201
+++ tramp.el    15 Jun 2008 16:57:03 -0000      1.202
@@ -5846,7 +5846,8 @@
 
   ;; Check whether the output of "uname -sr" has been changed.  If
   ;; yes, this is a strong indication that we must expire all
-  ;; connection properties.
+  ;; connection properties.  We start again with
+  ;; `tramp-maybe-open-connection', it will be catched there.
   (tramp-message vec 5 "Checking system information")
   (let ((old-uname (tramp-get-connection-property vec "uname" nil))
        (new-uname
@@ -5854,12 +5855,20 @@
          vec "uname"
          (tramp-send-command-and-read vec "echo \\\"`uname -sr`\\\""))))
     (when (and (stringp old-uname) (not (string-equal old-uname new-uname)))
+      (with-current-buffer (tramp-get-debug-buffer vec)
+       ;; Keep the debug buffer
+       (rename-buffer " *temp*" 'unique)
       (funcall (symbol-function 'tramp-cleanup-connection) vec)
-      (signal
-       'quit
-       (list (format
+       (if (= (point-min) (point-max))
+           (kill-buffer nil)
+         (rename-buffer (tramp-debug-buffer-name vec) 'unique))
+       ;; We call `tramp-get-buffer' in order to keep the debug buffer.
+       (tramp-get-buffer vec)
+       (tramp-message
+        vec 3
              "Connection reset, because remote host changed from `%s' to `%s'"
-             old-uname new-uname)))))
+        old-uname new-uname)
+       (throw 'uname-changed (tramp-maybe-open-connection vec)))))
 
   ;; Check whether the remote host suffers from buggy
   ;; `send-process-string'.  This is known for FreeBSD (see comment in
@@ -6222,15 +6231,16 @@
   "Maybe open a connection VEC.
 Does not do anything if a connection is already open, but re-opens the
 connection if a previous connection has died for some reason."
+  (catch 'uname-changed
   (let ((p (tramp-get-connection-process vec))
        (process-environment (copy-sequence process-environment)))
 
     ;; If too much time has passed since last command was sent, look
     ;; whether process is still alive.  If it isn't, kill it.  When
-    ;; using ssh, it can sometimes happen that the remote end has hung
-    ;; up but the local ssh client doesn't recognize this until it
-    ;; tries to send some data to the remote end.  So that's why we
-    ;; try to send a command from time to time, then look again
+      ;; using ssh, it can sometimes happen that the remote end has
+      ;; hung up but the local ssh client doesn't recognize this until
+      ;; it tries to send some data to the remote end.  So that's why
+      ;; we try to send a command from time to time, then look again
     ;; whether the process is really alive.
     (condition-case nil
        (when (and (> (tramp-time-diff
@@ -6334,14 +6344,14 @@
            (when (and gw gw-args)
              (setq login-args (append login-args gw-args)))
 
-           ;; Check for port number.  Until now, there's no need for handling
-           ;; like method, user, host.
+             ;; Check for port number.  Until now, there's no need
+             ;; for handling like method, user, host.
            (when (string-match tramp-host-with-port-regexp l-host)
              (setq l-port (match-string 2 l-host)
                    l-host (match-string 1 l-host)))
 
-           ;; Set variables for computing the prompt for reading password.
-           ;; They can also be derived from a gatewy.
+             ;; Set variables for computing the prompt for reading
+             ;; password.  They can also be derived from a gatewy.
            (setq tramp-current-method (or g-method l-method)
                  tramp-current-user   (or g-user   l-user)
                  tramp-current-host   (or g-host   l-host))
@@ -6361,12 +6371,12 @@
                  (setq x (mapcar '(lambda (y) (format-spec y spec)) x))
                  (unless (member "" x) (mapconcat 'identity x " ")))
               login-args " ")
-             ;; String to detect failed connection.  Every single word must
-             ;; be enclosed with '\"'; otherwise it is detected
-             ;; during connection setup.
-             ;; Local shell could be a Windows COMSPEC.  It doesn't know
-             ;; the ";" syntax, but we must exit always for `start-process'.
-             ;; "exec" does not work either.
+               ;; String to detect failed connection.  Every single
+               ;; word must be enclosed with '\"'; otherwise it is
+               ;; detected during connection setup.
+               ;; Local shell could be a Windows COMSPEC.  It doesn't
+               ;; know the ";" syntax, but we must exit always for
+               ;; `start-process'.  "exec" does not work either.
              (if first-hop
                  " && exit || exit"
                "; echo \"Tramp\" \"connection\" \"closed\"; sleep 1"))
@@ -6382,7 +6392,7 @@
          (setq target-alist (cdr target-alist)))
 
        ;; Make initial shell settings.
-       (tramp-open-connection-setup-interactive-shell p vec)))))
+         (tramp-open-connection-setup-interactive-shell p vec))))))
 
 (defun tramp-send-command (vec command &optional neveropen nooutput)
   "Send the COMMAND to connection VEC.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]