Use READ-CRLF-LINE instead of READ-LINE.
(FTP is TELNET-based.)
This commit is contained in:
parent
9109ecaaf6
commit
f7ca3d5393
|
@ -434,18 +434,18 @@
|
|||
(let-optionals* maybe-expected ((expected "2.."))
|
||||
(let* ((sock (ftp-connection-command-socket connection))
|
||||
(IN (socket:inport sock))
|
||||
(response (read-line IN)))
|
||||
(response (read-crlf-line IN)))
|
||||
(ftp-log connection (format #f "-> ~a" response))
|
||||
(or (string-match expected response)
|
||||
(signal 'ftp-error response))
|
||||
;; handle multi-line responses
|
||||
(if (equal? (string-ref response 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))
|
||||
(set! response (string-join (list response line "\n")))
|
||||
(or (string-match code line)
|
||||
(loop code (read-line IN)))))
|
||||
(loop code (read-crlf-line IN)))))
|
||||
response)))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue