diff --git a/scheme/lib/ftp.scm b/scheme/lib/ftp.scm index 11f0475..b2775d7 100644 --- a/scheme/lib/ftp.scm +++ b/scheme/lib/ftp.scm @@ -392,22 +392,12 @@ (define (ftp-build-PORT-string sockaddr) (let* ((hst-info (host-info (system-name))) (ip-address (car (host-info:addresses hst-info)))) - (receive (hst-address srvc-port) - (socket-address->internet-address sockaddr) - (let* ((num32 ip-address) - (num24 (arithmetic-shift num32 -8)) - (num16 (arithmetic-shift num24 -8)) - (num08 (arithmetic-shift num16 -8)) - (byte0 (bitwise-and #b11111111 num08)) - (byte1 (bitwise-and #b11111111 num16)) - (byte2 (bitwise-and #b11111111 num24)) - (byte3 (bitwise-and #b11111111 num32))) - (format #f "PORT ~a,~a,~a,~a,~a,~a" - byte0 byte1 byte2 byte3 - (arithmetic-shift srvc-port -8) ; high order byte - (bitwise-and #b11111111 srvc-port) ; lower order byte - ))))) - + (receive (hst-address srvc-port) + (socket-address->internet-address sockaddr) + (string-append "PORT " + (format-internet-host-address ip-address ",") + "," + (format-port srvc-port))))) (define (ftp-send-command connection command . maybe-expected) (let-optionals* maybe-expected ((expected "2..")) diff --git a/scheme/packages.scm b/scheme/packages.scm index a649e3e..11a90af 100644 --- a/scheme/packages.scm +++ b/scheme/packages.scm @@ -412,6 +412,7 @@ (subset srfi-13 (string-join)) let-opt sunet-utilities + format-net crlf-io) (files (lib ftp)))