Use READ-CRLF-LINE instead of READ-LINE.

(FTP is TELNET-based.)
This commit is contained in:
sperber 2003-01-15 15:39:13 +00:00
parent 9109ecaaf6
commit f7ca3d5393
1 changed files with 3 additions and 3 deletions

View File

@ -434,18 +434,18 @@
(let-optionals* maybe-expected ((expected "2..")) (let-optionals* maybe-expected ((expected "2.."))
(let* ((sock (ftp-connection-command-socket connection)) (let* ((sock (ftp-connection-command-socket connection))
(IN (socket:inport sock)) (IN (socket:inport sock))
(response (read-line IN))) (response (read-crlf-line IN)))
(ftp-log connection (format #f "-> ~a" response)) (ftp-log connection (format #f "-> ~a" response))
(or (string-match expected response) (or (string-match expected response)
(signal 'ftp-error response)) (signal 'ftp-error response))
;; handle multi-line responses ;; handle multi-line responses
(if (equal? (string-ref response 3) #\-) (if (equal? (string-ref response 3) #\-)
(let loop ((code (string-append (substring response 0 3) " ")) (let loop ((code (string-append (substring response 0 3) " "))
(line (read-line IN))) (line (read-crlf-line IN)))
(ftp-log connection (format #f "-> ~a" line)) (ftp-log connection (format #f "-> ~a" line))
(set! response (string-join (list response line "\n"))) (set! response (string-join (list response line "\n")))
(or (string-match code line) (or (string-match code line)
(loop code (read-line IN))))) (loop code (read-crlf-line IN)))))
response))) response)))