diff --git a/ftpd.scm b/ftpd.scm index 55788d8..128420b 100644 --- a/ftpd.scm +++ b/ftpd.scm @@ -499,22 +499,24 @@ (format-internet-host-address host-address ",") (format-port port)))))))) -; This doesn't look right. But I can't look into the socket of the -; control connection if we're running under inetd---there's no way to -; coerce a port to a socket as there is in C. +;; This doesn't look right. But I can't look into the socket of the +;; control connection if we're running under inetd---there's no way to +;; coerce a port to a socket as there is in C. (define (this-host-address) (car (host-info:addresses (host-info (system-name))))) -(define (format-internet-host-address address) +(define (format-internet-host-address address . maybe-separator) (define (extract shift) (number->string (bitwise-and (arithmetic-shift address (- shift)) 255))) - (string-append - (extract 24) "." (extract 16) "." (extract 8) "." (extract 0))) + (let ((separator (optional maybe-separator "."))) + (string-append + (extract 24) separator (extract 16) separator + (extract 8) separator (extract 0)))) (define (format-port port) (string-append @@ -808,7 +810,7 @@ ; Version -(define *ftpd-version* "$Revision: 1.13 $") +(define *ftpd-version* "$Revision: 1.14 $") (define (copy-port->port-binary input-port output-port) (let ((buffer (make-string *window-size*)))