Almost there.

This commit is contained in:
Diego Nehab 2004-05-28 07:47:41 +00:00
parent 84f03fda7c
commit 6c565dd7c0
11 changed files with 20 additions and 14 deletions

3
TODO
View File

@ -35,6 +35,9 @@
* Create a passive mode option for the FTP (good for firewall).
* Modules should return their namespace table in the end of the chunk.
get.lua precisa de ftp.get com url e sink
make sure filter.chain fails gracefully.
ajeitar o manual sobre select, mais liberal agora
conjunto associativo

View File

@ -5,7 +5,6 @@
-- RCS ID: $Id$
-----------------------------------------------------------------------------
require"luasocket"
require"http"
socket.http.TIMEOUT = 10

View File

@ -1,6 +1,9 @@
require"mime.lua"
require"ltn12.lua"
local marker = '\n'
if arg and arg[1] == '-d' then marker = '\r\n' end
local filter = mime.normalize(marker)
local source = ltn12.source.chain(ltn12.source.file(io.stdin), filter)
local sink = ltn12.sink.file(io.stdout)
ltn12.pump(source, sink)
ltn12.pump.all(source, sink)

View File

@ -4,6 +4,10 @@
-- Author: Diego Nehab
-- RCS ID: $Id$
-----------------------------------------------------------------------------
require"http"
require"ftp"
require"url"
-- formats a number of seconds into human readable form
function nicetime(s)
local l = "s"

View File

@ -1,4 +1,3 @@
require"luasocket"
require"http"
if not arg or not arg[1] or not arg[2] then

View File

@ -6,10 +6,9 @@
-- RCS ID: $Id$
-----------------------------------------------------------------------------
-- make sure LuaSocket is loaded
if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end
require("luasocket")
-- get LuaSocket namespace
local socket = _G[LUASOCKET_LIBNAME]
if not socket then error('module requires LuaSocket') end
-- require other modules
require("ltn12")

View File

@ -6,10 +6,9 @@
-- RCS ID: $Id$
-----------------------------------------------------------------------------
-- make sure LuaSocket is loaded
if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end
require("luasocket")
-- get LuaSocket namespace
local socket = _G[LUASOCKET_LIBNAME]
if not socket then error('module requires LuaSocket') end
-- require other modules
require("ltn12")

View File

@ -6,10 +6,11 @@
-- RCS ID: $Id$
-----------------------------------------------------------------------------
-- make sure LuaSocket is loaded
if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end
require"luasocket"
-- get LuaSocket namespace
local socket = _G[LUASOCKET_LIBNAME]
if not socket then error('module requires LuaSocket') end
require"ltn12"
-- create smtp namespace inside LuaSocket namespace
local smtp = socket.smtp or {}
@ -18,6 +19,7 @@ socket.smtp = smtp
setmetatable(smtp, { __index = _G })
setfenv(1, smtp)
-- default server used to send e-mails
SERVER = "localhost"
-- default port

View File

@ -5,13 +5,11 @@
-- Conforming to: RFC 2396, LTN7
-- RCS ID: $Id$
----------------------------------------------------------------------------
-- make sure LuaSocket is loaded
if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end
require"luasocket"
-- get LuaSocket namespace
local socket = _G[LUASOCKET_LIBNAME]
if not socket then error('module requires LuaSocket') end
-- create smtp namespace inside LuaSocket namespace
-- create url namespace inside LuaSocket namespace
local url = socket.url or {}
socket.url = url
-- make all module globals fall into smtp namespace

View File

@ -4,7 +4,6 @@
-- to "/luasocket-test-cgi" and "/luasocket-test-cgi/"
-- needs "AllowOverride AuthConfig" on /home/c/diego/tec/luasocket/test/auth
require("luasocket")
require("http")
dofile("testsupport.lua")

View File

@ -1,3 +1,4 @@
require"url"
dofile("testsupport.lua")
local check_build_url = function(parsed)