diff --git a/vlib/net/ftp/ftp.v b/vlib/net/ftp/ftp.v index 023023450f..01db981bc7 100644 --- a/vlib/net/ftp/ftp.v +++ b/vlib/net/ftp/ftp.v @@ -100,9 +100,9 @@ fn (mut zftp FTP) read() !(int, string) { return code, data } -// connect establishes an FTP connection to the host at `ip` port 21. -pub fn (mut zftp FTP) connect(ip string) !bool { - zftp.conn = net.dial_tcp('${ip}:21')! +// connect establishes an FTP connection to the host at `oaddress` (ip:port). +pub fn (mut zftp FTP) connect(oaddress string) !bool { + zftp.conn = net.dial_tcp(oaddress)! zftp.reader = io.new_buffered_reader(reader: zftp.conn) code, _ := zftp.read()! if code == ftp.connected { diff --git a/vlib/net/ftp/ftp_test.v b/vlib/net/ftp/ftp_test.v index 539a9ef13b..bfea567bb3 100644 --- a/vlib/net/ftp/ftp_test.v +++ b/vlib/net/ftp/ftp_test.v @@ -17,7 +17,7 @@ fn ftp_client_test_inside() ! { defer { zftp.close() or { panic(err) } } - connect_result := zftp.connect('ftp.redhat.com')! + connect_result := zftp.connect('ftp.redhat.com:21')! assert connect_result login_result := zftp.login('ftp', 'ftp')! assert login_result