/[emacs]/emacs/lisp/net/ange-ftp.el
ViewVC logotype

Diff of /emacs/lisp/net/ange-ftp.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.67 by lute, Mon Jul 4 17:10:35 2005 UTC revision 1.68 by monnier, Thu Jul 28 15:28:44 2005 UTC
# Line 743  These mean that the FTP process should ( Line 743  These mean that the FTP process should (
743    :group 'ange-ftp    :group 'ange-ftp
744    :type 'regexp)    :type 'regexp)
745    
746    (defcustom ange-ftp-potential-error-msgs
747      ;; On Mac OS X we sometimes get things like:
748      ;;
749      ;;     ftp> open ftp.nluug.nl
750      ;;     Trying 2001:610:1:80aa:192:87:102:36...
751      ;;     ftp: connect to address 2001:610:1:80aa:192:87:102:36: No route to host
752      ;;     Trying 192.87.102.36...
753      ;;     Connected to ftp.nluug.nl.
754      "^ftp: connect to address .*: No route to host"
755      "*Regular expression matching ftp messages that can indicate serious errors.
756    These mean that something went wrong, but they may be followed by more
757    messages indicating that the error was somehow corrected."
758      :group 'ange-ftp
759      :type 'regexp)
760    
761  (defcustom ange-ftp-gateway-fatal-msgs  (defcustom ange-ftp-gateway-fatal-msgs
762    "No route to host\\|Connection closed\\|No such host\\|Login incorrect"    "No route to host\\|Connection closed\\|No such host\\|Login incorrect"
763    "*Regular expression matching login failure messages from rlogin/telnet."    "*Regular expression matching login failure messages from rlogin/telnet."
# Line 1071  All HOST values should be in lower case. Line 1086  All HOST values should be in lower case.
1086  (defvar ange-ftp-xfer-size nil)  (defvar ange-ftp-xfer-size nil)
1087  (defvar ange-ftp-process-string nil)  (defvar ange-ftp-process-string nil)
1088  (defvar ange-ftp-process-result-line nil)  (defvar ange-ftp-process-result-line nil)
1089    (defvar ange-ftp-pending-error-line nil)
1090  (defvar ange-ftp-process-busy nil)  (defvar ange-ftp-process-busy nil)
1091  (defvar ange-ftp-process-result nil)  (defvar ange-ftp-process-result nil)
1092  (defvar ange-ftp-process-multi-skip nil)  (defvar ange-ftp-process-multi-skip nil)
# Line 1544  good, skip, fatal, or unknown." Line 1560  good, skip, fatal, or unknown."
1560          ((string-match ange-ftp-good-msgs line)          ((string-match ange-ftp-good-msgs line)
1561           (setq ange-ftp-process-busy nil           (setq ange-ftp-process-busy nil
1562                 ange-ftp-process-result t                 ange-ftp-process-result t
1563                   ange-ftp-pending-error-line nil
1564                 ange-ftp-process-result-line line))                 ange-ftp-process-result-line line))
1565          ;; Check this before checking for errors.          ;; Check this before checking for errors.
1566          ;; Otherwise the last line of these three seems to be an error:          ;; Otherwise the last line of these three seems to be an error:
# Line 1552  good, skip, fatal, or unknown." Line 1569  good, skip, fatal, or unknown."
1569          ;; 230-"ftp.stsci.edu: unknown host", the new IP address will be...          ;; 230-"ftp.stsci.edu: unknown host", the new IP address will be...
1570          ((string-match ange-ftp-multi-msgs line)          ((string-match ange-ftp-multi-msgs line)
1571           (setq ange-ftp-process-multi-skip t))           (setq ange-ftp-process-multi-skip t))
1572            ((string-match ange-ftp-potential-error-msgs line)
1573             ;; This looks like an error, but we have to keep reading the output
1574             ;; to see if it was fixed or not.  E.g. it may indicate that IPv6
1575             ;; failed, but maybe a subsequent IPv4 fallback succeeded.
1576             (set (make-local-variable 'ange-ftp-pending-error-line) line)
1577             t)
1578          ((string-match ange-ftp-fatal-msgs line)          ((string-match ange-ftp-fatal-msgs line)
1579           (delete-process proc)           (delete-process proc)
1580           (setq ange-ftp-process-busy nil           (setq ange-ftp-process-busy nil
1581                 ange-ftp-process-result-line line))                 ange-ftp-process-result-line line))
1582          (ange-ftp-process-multi-skip          (ange-ftp-process-multi-skip
1583           t)           t)
1584          (t          (t
1585           (setq ange-ftp-process-busy nil           (setq ange-ftp-process-busy nil
# Line 1651  good, skip, fatal, or unknown." Line 1674  good, skip, fatal, or unknown."
1674                            (string-match "\n" ange-ftp-process-string))                            (string-match "\n" ange-ftp-process-string))
1675                  (let ((line (substring ange-ftp-process-string                  (let ((line (substring ange-ftp-process-string
1676                                         0                                         0
1677                                         (match-beginning 0))))                                         (match-beginning 0)))
1678                          (seen-prompt nil))
1679                    (setq ange-ftp-process-string (substring ange-ftp-process-string                    (setq ange-ftp-process-string (substring ange-ftp-process-string
1680                                                             (match-end 0)))                                                             (match-end 0)))
1681                    (while (string-match "^ftp> *" line)                    (while (string-match "^ftp> *" line)
1682                        (setq seen-prompt t)
1683                      (setq line (substring line (match-end 0))))                      (setq line (substring line (match-end 0))))
1684                    (ange-ftp-process-handle-line line proc)))                    (if (not (and seen-prompt ange-ftp-pending-error-line))
1685                          (ange-ftp-process-handle-line line proc)
1686                        ;; If we've seen a potential error message and it
1687                        ;; hasn't been cancelled by a good message before
1688                        ;; seeing a propt, then the error was real.
1689                        (delete-process proc)
1690                        (setq ange-ftp-process-busy nil
1691                              ange-ftp-process-result-line ange-ftp-pending-error-line))))
1692    
1693                ;; has the ftp client finished?  if so then do some clean-up                ;; has the ftp client finished?  if so then do some clean-up
1694                ;; actions.                ;; actions.
# Line 1988  on the gateway machine to do the ftp ins Line 2020  on the gateway machine to do the ftp ins
2020    (make-local-variable 'comint-password-prompt-regexp)    (make-local-variable 'comint-password-prompt-regexp)
2021    ;; This is a regexp that can't match anything.    ;; This is a regexp that can't match anything.
2022    ;; ange-ftp has its own ways of handling passwords.    ;; ange-ftp has its own ways of handling passwords.
2023    (setq comint-password-prompt-regexp "^a\\'z")    (setq comint-password-prompt-regexp "\\`a\\`")
2024    (make-local-variable 'paragraph-start)    (make-local-variable 'paragraph-start)
2025    (setq paragraph-start comint-prompt-regexp)    (setq paragraph-start comint-prompt-regexp)
2026    (run-mode-hooks 'internal-ange-ftp-mode-hook))    (run-mode-hooks 'internal-ange-ftp-mode-hook))
# Line 4543  NEWNAME should be the name to give the n Line 4575  NEWNAME should be the name to give the n
4575    (setq ange-ftp-ls-cache-file nil)     ;Stop confusing Dired.    (setq ange-ftp-ls-cache-file nil)     ;Stop confusing Dired.
4576    0)    0)
4577    
4578  ;;; This is turned off because it has nothing properly to do  ;; This is turned off because it has nothing properly to do
4579  ;;; with dired.  It could be reasonable to adapt this to  ;; with dired.  It could be reasonable to adapt this to
4580  ;;; replace ange-ftp-copy-file.  ;; replace ange-ftp-copy-file.
4581    
4582  ;;;;; ------------------------------------------------------------  ;;;;; ------------------------------------------------------------
4583  ;;;;; Noddy support for async copy-file within dired.  ;;;;; Noddy support for async copy-file within dired.

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26