From 23ce5aeaa22b49d6649096b520b292a3626474ef Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Mon, 7 Mar 2016 01:33:08 -0300 Subject: [PATCH] Hide ftp.PORT "constant" as a local --- doc/ftp.html | 1 - src/ftp.lua | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/ftp.html b/doc/ftp.html index 3f23a4a..091c88f 100644 --- a/doc/ftp.html +++ b/doc/ftp.html @@ -86,7 +86,6 @@ the FTP module: diff --git a/src/ftp.lua b/src/ftp.lua index 11798ad..bd528ca 100644 --- a/src/ftp.lua +++ b/src/ftp.lua @@ -23,7 +23,7 @@ local _M = socket.ftp -- timeout in seconds before the program gives up on a connection _M.TIMEOUT = 60 -- default port for ftp service -_M.PORT = 21 +local PORT = 21 -- this is the default anonymous password. used when no password is -- provided in url. should be changed to your e-mail. _M.USER = "ftp" @@ -35,7 +35,7 @@ _M.PASSWORD = "anonymous@anonymous.org" local metat = { __index = {} } function _M.open(server, port, create) - local tp = socket.try(tp.connect(server, port or _M.PORT, _M.TIMEOUT, create)) + local tp = socket.try(tp.connect(server, port or PORT, _M.TIMEOUT, create)) local f = base.setmetatable({ tp = tp }, metat) -- make sure everything gets closed in an exception f.try = socket.newtry(function() f:close() end)