moving proc socket-address->string from ftpd internal to sunet-utilities exports

This commit is contained in:
interp 2002-08-24 16:43:26 +00:00
parent dc20fd05b6
commit 514d61b986
3 changed files with 16 additions and 13 deletions

View File

@ -179,17 +179,6 @@
(socket:outport socket)))
(define (socket-address->string socket-address . with-port?)
(let ((with-port? (optional with-port? #t)))
(receive (host-address service-port)
(socket-address->internet-address socket-address)
(if with-port?
(format #f "~A:~A"
(format-internet-host-address host-address)
(format-port service-port))
(format #f "~A"
(format-internet-host-address host-address))))))
;;; ftpd -------------------------------------------------------
(define (ftpd anonymous-home . maybe-args)
@ -1229,7 +1218,7 @@
; Version
(define *ftpd-version* "$Revision: 1.4 $")
(define *ftpd-version* "$Revision: 1.5 $")
(define (copy-port->port-binary input-port output-port)
(let ((buffer (make-string *window-size*)))

View File

@ -14,3 +14,15 @@
(let ((next (next-sigevent event interrupt)))
(thunk)
(lp next))))
(define (socket-address->string socket-address . with-port?)
(let ((with-port? (:optional with-port? #t)))
(receive (host-address service-port)
(socket-address->internet-address socket-address)
(if with-port?
(format #f "~A:~A"
(format-internet-host-address host-address)
(format-port service-port))
(format #f "~A"
(format-internet-host-address host-address))))))

View File

@ -232,7 +232,8 @@
(define-interface sunet-utilities-interface
(export host-name-or-ip
on-interrupt))
on-interrupt
socket-address->string))
(define-interface handle-fatal-error-interface
(export with-fatal-error-handler*
@ -598,6 +599,7 @@
scheme
format-net
sigevents
let-opt
handle-fatal-error)
(files (lib sunet-utilities)))