Function: ange-ftp-process-handle-line

ange-ftp-process-handle-line is a byte-compiled function defined in ange-ftp.el.gz.

Signature

(ange-ftp-process-handle-line LINE PROC)

Documentation

Look at the given LINE from the FTP process PROC.

Try to categorize it into one of four categories: good, skip, fatal, or unknown.

Source Code

;; Defined in /usr/src/emacs/lisp/net/ange-ftp.el.gz
;;;; ------------------------------------------------------------
;;;; FTP process filter support.
;;;; ------------------------------------------------------------

(defun ange-ftp-process-handle-line (line proc)
  "Look at the given LINE from the FTP process PROC.
Try to categorize it into one of four categories:
good, skip, fatal, or unknown."
  (cond ((string-match ange-ftp-xfer-size-msgs line)
	 (setq ange-ftp-xfer-size
	       (/ (string-to-number (match-string 1 line))
		  1024)))
	((string-match ange-ftp-skip-msgs line)
	 t)
	((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:
	;; 230-see a significant impact from the move.  For those of you who can't
	;; 230-use DNS to resolve hostnames and get an error message like
	;; 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.
         (setq-local 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
	       ange-ftp-process-result-line line))))