From 7b285f1fd32a3f3b347fd25a1ba7ad1c5c02154d Mon Sep 17 00:00:00 2001 From: sperber Date: Wed, 20 Jun 2001 13:25:41 +0000 Subject: [PATCH] Optional separator for FORMAT-INTERNET-HOST-ADRESS (which had been ripped out at some point). --- ftpd.scm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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*)))