mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 04:28:20 +01:00
Almost there.
This commit is contained in:
parent
84f03fda7c
commit
6c565dd7c0
3
TODO
3
TODO
@ -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
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
-- RCS ID: $Id$
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
require"luasocket"
|
||||
require"http"
|
||||
|
||||
socket.http.TIMEOUT = 10
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
|
@ -1,4 +1,3 @@
|
||||
require"luasocket"
|
||||
require"http"
|
||||
|
||||
if not arg or not arg[1] or not arg[2] then
|
||||
|
@ -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")
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
|
@ -1,3 +1,4 @@
|
||||
require"url"
|
||||
dofile("testsupport.lua")
|
||||
|
||||
local check_build_url = function(parsed)
|
||||
|
Loading…
Reference in New Issue
Block a user