+ Temporary fix in this-host-address: close the socket obtained from

port->socket.

+ read-crlf-line doesn't accept a timeout and it would be nonsense in
  copy-ascii-port->port anyway.
This commit is contained in:
mainzelm 2002-12-11 10:05:50 +00:00
parent 4bee3e42f5
commit 34a2ace724
1 changed files with 12 additions and 10 deletions

View File

@ -974,13 +974,17 @@
formatted-port)))))))) formatted-port))))))))
(define (this-host-address) (define (this-host-address)
(call-with-values (let ((socket (port->socket (the-session-control-input-port)
(lambda () protocol-family/internet)))
(socket-address->internet-address (call-with-values
(socket-local-address (port->socket (the-session-control-input-port) (lambda ()
protocol-family/internet)))) (socket-address->internet-address
(lambda (host-address control-port) (socket-local-address socket)))
host-address))) (lambda (host-address control-port)
(log (syslog-level debug) "Closing ~A ~A"
(socket:inport socket) (socket:outport socket))
(close-socket socket)
host-address))))
(define (handle-nlst arg) (define (handle-nlst arg)
(log-command (syslog-level info) "NLST" arg) (log-command (syslog-level info) "NLST" arg)
@ -1367,9 +1371,7 @@
(define (copy-ascii-port->port input-port output-port) (define (copy-ascii-port->port input-port output-port)
(let loop () (let loop ()
(let* ((line (read-crlf-line input-port (let* ((line (read-crlf-line input-port
#f #f))
90000 ; timeout
500)) ; max interval
(length (string-length line))) (length (string-length line)))
(if (not (eof-object? line)) (if (not (eof-object? line))
(begin (begin