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/ange-ftp.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/net/ange-ftp.el
Date: Thu, 28 Jul 2005 11:28:46 -0400

Index: emacs/lisp/net/ange-ftp.el
diff -c emacs/lisp/net/ange-ftp.el:1.67 emacs/lisp/net/ange-ftp.el:1.68
*** emacs/lisp/net/ange-ftp.el:1.67     Mon Jul  4 17:10:35 2005
--- emacs/lisp/net/ange-ftp.el  Thu Jul 28 15:28:44 2005
***************
*** 743,748 ****
--- 743,763 ----
    :group 'ange-ftp
    :type 'regexp)
  
+ (defcustom ange-ftp-potential-error-msgs
+   ;; On Mac OS X we sometimes get things like:
+   ;; 
+   ;;     ftp> open ftp.nluug.nl
+   ;;     Trying 2001:610:1:80aa:192:87:102:36...
+   ;;     ftp: connect to address 2001:610:1:80aa:192:87:102:36: No route to 
host
+   ;;     Trying 192.87.102.36...
+   ;;     Connected to ftp.nluug.nl.
+   "^ftp: connect to address .*: No route to host"
+   "*Regular expression matching ftp messages that can indicate serious errors.
+ These mean that something went wrong, but they may be followed by more
+ messages indicating that the error was somehow corrected."
+   :group 'ange-ftp
+   :type 'regexp)
+ 
  (defcustom ange-ftp-gateway-fatal-msgs
    "No route to host\\|Connection closed\\|No such host\\|Login incorrect"
    "*Regular expression matching login failure messages from rlogin/telnet."
***************
*** 1071,1076 ****
--- 1086,1092 ----
  (defvar ange-ftp-xfer-size nil)
  (defvar ange-ftp-process-string nil)
  (defvar ange-ftp-process-result-line nil)
+ (defvar ange-ftp-pending-error-line nil)
  (defvar ange-ftp-process-busy nil)
  (defvar ange-ftp-process-result nil)
  (defvar ange-ftp-process-multi-skip nil)
***************
*** 1544,1549 ****
--- 1560,1566 ----
        ((string-match ange-ftp-good-msgs line)
         (setq ange-ftp-process-busy nil
               ange-ftp-process-result t
+                ange-ftp-pending-error-line nil
               ange-ftp-process-result-line line))
        ;; Check this before checking for errors.
        ;; Otherwise the last line of these three seems to be an error:
***************
*** 1552,1562 ****
        ;; 230-"ftp.stsci.edu: unknown host", the new IP address will be...
        ((string-match ange-ftp-multi-msgs line)
         (setq ange-ftp-process-multi-skip t))
        ((string-match ange-ftp-fatal-msgs line)
         (delete-process proc)
         (setq ange-ftp-process-busy nil
               ange-ftp-process-result-line line))
!       (ange-ftp-process-multi-skip
         t)
        (t
         (setq ange-ftp-process-busy nil
--- 1569,1585 ----
        ;; 230-"ftp.stsci.edu: unknown host", the new IP address will be...
        ((string-match ange-ftp-multi-msgs line)
         (setq ange-ftp-process-multi-skip t))
+       ((string-match ange-ftp-potential-error-msgs line)
+          ;; This looks like an error, but we have to keep reading the output
+          ;; to see if it was fixed or not.  E.g. it may indicate that IPv6
+          ;; failed, but maybe a subsequent IPv4 fallback succeeded.
+          (set (make-local-variable 'ange-ftp-pending-error-line) line)
+          t)
        ((string-match ange-ftp-fatal-msgs line)
         (delete-process proc)
         (setq ange-ftp-process-busy nil
               ange-ftp-process-result-line line))
!         (ange-ftp-process-multi-skip
         t)
        (t
         (setq ange-ftp-process-busy nil
***************
*** 1651,1662 ****
                          (string-match "\n" ange-ftp-process-string))
                (let ((line (substring ange-ftp-process-string
                                       0
!                                      (match-beginning 0))))
                  (setq ange-ftp-process-string (substring 
ange-ftp-process-string
                                                           (match-end 0)))
                  (while (string-match "^ftp> *" line)
                    (setq line (substring line (match-end 0))))
!                 (ange-ftp-process-handle-line line proc)))
  
              ;; has the ftp client finished?  if so then do some clean-up
              ;; actions.
--- 1674,1694 ----
                          (string-match "\n" ange-ftp-process-string))
                (let ((line (substring ange-ftp-process-string
                                       0
!                                      (match-beginning 0)))
!                       (seen-prompt nil))
                  (setq ange-ftp-process-string (substring 
ange-ftp-process-string
                                                           (match-end 0)))
                  (while (string-match "^ftp> *" line)
+                     (setq seen-prompt t)
                    (setq line (substring line (match-end 0))))
!                   (if (not (and seen-prompt ange-ftp-pending-error-line))
!                       (ange-ftp-process-handle-line line proc)
!                     ;; If we've seen a potential error message and it
!                     ;; hasn't been cancelled by a good message before
!                     ;; seeing a propt, then the error was real.
!                     (delete-process proc)
!                     (setq ange-ftp-process-busy nil
!                           ange-ftp-process-result-line 
ange-ftp-pending-error-line))))
  
              ;; has the ftp client finished?  if so then do some clean-up
              ;; actions.
***************
*** 1988,1994 ****
    (make-local-variable 'comint-password-prompt-regexp)
    ;; This is a regexp that can't match anything.
    ;; ange-ftp has its own ways of handling passwords.
!   (setq comint-password-prompt-regexp "^a\\'z")
    (make-local-variable 'paragraph-start)
    (setq paragraph-start comint-prompt-regexp)
    (run-mode-hooks 'internal-ange-ftp-mode-hook))
--- 2020,2026 ----
    (make-local-variable 'comint-password-prompt-regexp)
    ;; This is a regexp that can't match anything.
    ;; ange-ftp has its own ways of handling passwords.
!   (setq comint-password-prompt-regexp "\\`a\\`")
    (make-local-variable 'paragraph-start)
    (setq paragraph-start comint-prompt-regexp)
    (run-mode-hooks 'internal-ange-ftp-mode-hook))
***************
*** 4543,4551 ****
    (setq ange-ftp-ls-cache-file nil)   ;Stop confusing Dired.
    0)
  
! ;;; This is turned off because it has nothing properly to do
! ;;; with dired.  It could be reasonable to adapt this to
! ;;; replace ange-ftp-copy-file.
  
  ;;;;; ------------------------------------------------------------
  ;;;;; Noddy support for async copy-file within dired.
--- 4575,4583 ----
    (setq ange-ftp-ls-cache-file nil)   ;Stop confusing Dired.
    0)
  
! ;; This is turned off because it has nothing properly to do
! ;; with dired.  It could be reasonable to adapt this to
! ;; replace ange-ftp-copy-file.
  
  ;;;;; ------------------------------------------------------------
  ;;;;; Noddy support for async copy-file within dired.




reply via email to

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