From 2278144662988a3573c1fd0647f27e961d0fe84f Mon Sep 17 00:00:00 2001 From: mainzelm Date: Wed, 20 Jun 2001 16:21:41 +0000 Subject: [PATCH] Now that bind is fixed in scsh we can drop internet-address/any. Use scsh's new port->socket to determine the address of the host via the session-control-input-port. --- ftpd.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ftpd.scm b/ftpd.scm index 49a7d39..79b684f 100644 --- a/ftpd.scm +++ b/ftpd.scm @@ -480,9 +480,8 @@ (set-socket-option socket level/socket socket/reuse-address #t) - ;; kludge (bind-socket socket - (internet-address->socket-address internet-address/any + (internet-address->socket-address (this-host-address) 0)) (listen-socket socket 1) @@ -499,12 +498,14 @@ (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. - (define (this-host-address) - (car (host-info:addresses (host-info (system-name))))) + (call-with-values + (lambda () + (socket-address->internet-address + (socket-local-address (port->socket (session-control-input-port) + protocol-family/internet)))) + (lambda (host-address control-port) + host-address))) (define (format-internet-host-address address . maybe-separator) @@ -810,7 +811,7 @@ ; Version -(define *ftpd-version* "$Revision: 1.15 $") +(define *ftpd-version* "$Revision: 1.16 $") (define (copy-port->port-binary input-port output-port) (let ((buffer (make-string *window-size*)))