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.
This commit is contained in:
parent
899a7d6f30
commit
2278144662
17
ftpd.scm
17
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*)))
|
||||
|
|
Loading…
Reference in New Issue