aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-28 07:47:41 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-28 07:47:41 +0000
commit6c565dd7c06c96fd9b3394ade61f46da59590d30 (patch)
treef303c1a94627e002fa4dd73d2f2641596b8b1420
parent84f03fda7c2be57e14f937e295710b5e883fedc6 (diff)
downloadluasocket-6c565dd7c06c96fd9b3394ade61f46da59590d30.tar.gz
luasocket-6c565dd7c06c96fd9b3394ade61f46da59590d30.tar.bz2
luasocket-6c565dd7c06c96fd9b3394ade61f46da59590d30.zip
Almost there.
-rw-r--r--TODO3
-rw-r--r--etc/check-links.lua1
-rw-r--r--etc/eol.lua5
-rw-r--r--etc/get.lua4
-rw-r--r--samples/cddb.lua1
-rw-r--r--src/ftp.lua3
-rw-r--r--src/http.lua3
-rw-r--r--src/smtp.lua6
-rw-r--r--src/url.lua6
-rw-r--r--test/httptest.lua1
-rw-r--r--test/urltest.lua1
11 files changed, 20 insertions, 14 deletions
diff --git a/TODO b/TODO
index 2d846fe..838be3d 100644
--- a/TODO
+++ b/TODO
@@ -35,6 +35,9 @@
35* Create a passive mode option for the FTP (good for firewall). 35* Create a passive mode option for the FTP (good for firewall).
36* Modules should return their namespace table in the end of the chunk. 36* Modules should return their namespace table in the end of the chunk.
37 37
38
39get.lua precisa de ftp.get com url e sink
40make sure filter.chain fails gracefully.
38ajeitar o manual sobre select, mais liberal agora 41ajeitar o manual sobre select, mais liberal agora
39conjunto associativo 42conjunto associativo
40 43
diff --git a/etc/check-links.lua b/etc/check-links.lua
index c200dfb..898ed4b 100644
--- a/etc/check-links.lua
+++ b/etc/check-links.lua
@@ -5,7 +5,6 @@
5-- RCS ID: $Id$ 5-- RCS ID: $Id$
6----------------------------------------------------------------------------- 6-----------------------------------------------------------------------------
7 7
8require"luasocket"
9require"http" 8require"http"
10 9
11socket.http.TIMEOUT = 10 10socket.http.TIMEOUT = 10
diff --git a/etc/eol.lua b/etc/eol.lua
index aa43596..b13684b 100644
--- a/etc/eol.lua
+++ b/etc/eol.lua
@@ -1,6 +1,9 @@
1require"mime.lua"
2require"ltn12.lua"
3
1local marker = '\n' 4local marker = '\n'
2if arg and arg[1] == '-d' then marker = '\r\n' end 5if arg and arg[1] == '-d' then marker = '\r\n' end
3local filter = mime.normalize(marker) 6local filter = mime.normalize(marker)
4local source = ltn12.source.chain(ltn12.source.file(io.stdin), filter) 7local source = ltn12.source.chain(ltn12.source.file(io.stdin), filter)
5local sink = ltn12.sink.file(io.stdout) 8local sink = ltn12.sink.file(io.stdout)
6ltn12.pump(source, sink) 9ltn12.pump.all(source, sink)
diff --git a/etc/get.lua b/etc/get.lua
index aa29ec2..cc270e8 100644
--- a/etc/get.lua
+++ b/etc/get.lua
@@ -4,6 +4,10 @@
4-- Author: Diego Nehab 4-- Author: Diego Nehab
5-- RCS ID: $Id$ 5-- RCS ID: $Id$
6----------------------------------------------------------------------------- 6-----------------------------------------------------------------------------
7require"http"
8require"ftp"
9require"url"
10
7-- formats a number of seconds into human readable form 11-- formats a number of seconds into human readable form
8function nicetime(s) 12function nicetime(s)
9 local l = "s" 13 local l = "s"
diff --git a/samples/cddb.lua b/samples/cddb.lua
index 09309e8..d2e5b59 100644
--- a/samples/cddb.lua
+++ b/samples/cddb.lua
@@ -1,4 +1,3 @@
1require"luasocket"
2require"http" 1require"http"
3 2
4if not arg or not arg[1] or not arg[2] then 3if not arg or not arg[1] or not arg[2] then
diff --git a/src/ftp.lua b/src/ftp.lua
index efb872a..f197018 100644
--- a/src/ftp.lua
+++ b/src/ftp.lua
@@ -6,10 +6,9 @@
6-- RCS ID: $Id$ 6-- RCS ID: $Id$
7----------------------------------------------------------------------------- 7-----------------------------------------------------------------------------
8-- make sure LuaSocket is loaded 8-- make sure LuaSocket is loaded
9if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end 9require("luasocket")
10-- get LuaSocket namespace 10-- get LuaSocket namespace
11local socket = _G[LUASOCKET_LIBNAME] 11local socket = _G[LUASOCKET_LIBNAME]
12if not socket then error('module requires LuaSocket') end
13 12
14-- require other modules 13-- require other modules
15require("ltn12") 14require("ltn12")
diff --git a/src/http.lua b/src/http.lua
index e6a0928..7dee8e6 100644
--- a/src/http.lua
+++ b/src/http.lua
@@ -6,10 +6,9 @@
6-- RCS ID: $Id$ 6-- RCS ID: $Id$
7----------------------------------------------------------------------------- 7-----------------------------------------------------------------------------
8-- make sure LuaSocket is loaded 8-- make sure LuaSocket is loaded
9if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end 9require("luasocket")
10-- get LuaSocket namespace 10-- get LuaSocket namespace
11local socket = _G[LUASOCKET_LIBNAME] 11local socket = _G[LUASOCKET_LIBNAME]
12if not socket then error('module requires LuaSocket') end
13 12
14-- require other modules 13-- require other modules
15require("ltn12") 14require("ltn12")
diff --git a/src/smtp.lua b/src/smtp.lua
index 1d1905e..8b5e622 100644
--- a/src/smtp.lua
+++ b/src/smtp.lua
@@ -6,10 +6,11 @@
6-- RCS ID: $Id$ 6-- RCS ID: $Id$
7----------------------------------------------------------------------------- 7-----------------------------------------------------------------------------
8-- make sure LuaSocket is loaded 8-- make sure LuaSocket is loaded
9if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end 9require"luasocket"
10-- get LuaSocket namespace 10-- get LuaSocket namespace
11local socket = _G[LUASOCKET_LIBNAME] 11local socket = _G[LUASOCKET_LIBNAME]
12if not socket then error('module requires LuaSocket') end 12
13require"ltn12"
13 14
14-- create smtp namespace inside LuaSocket namespace 15-- create smtp namespace inside LuaSocket namespace
15local smtp = socket.smtp or {} 16local smtp = socket.smtp or {}
@@ -18,6 +19,7 @@ socket.smtp = smtp
18setmetatable(smtp, { __index = _G }) 19setmetatable(smtp, { __index = _G })
19setfenv(1, smtp) 20setfenv(1, smtp)
20 21
22
21-- default server used to send e-mails 23-- default server used to send e-mails
22SERVER = "localhost" 24SERVER = "localhost"
23-- default port 25-- default port
diff --git a/src/url.lua b/src/url.lua
index 0fba14d..b385d88 100644
--- a/src/url.lua
+++ b/src/url.lua
@@ -5,13 +5,11 @@
5-- Conforming to: RFC 2396, LTN7 5-- Conforming to: RFC 2396, LTN7
6-- RCS ID: $Id$ 6-- RCS ID: $Id$
7---------------------------------------------------------------------------- 7----------------------------------------------------------------------------
8
9-- make sure LuaSocket is loaded 8-- make sure LuaSocket is loaded
10if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end 9require"luasocket"
11-- get LuaSocket namespace 10-- get LuaSocket namespace
12local socket = _G[LUASOCKET_LIBNAME] 11local socket = _G[LUASOCKET_LIBNAME]
13if not socket then error('module requires LuaSocket') end 12-- create url namespace inside LuaSocket namespace
14-- create smtp namespace inside LuaSocket namespace
15local url = socket.url or {} 13local url = socket.url or {}
16socket.url = url 14socket.url = url
17-- make all module globals fall into smtp namespace 15-- make all module globals fall into smtp namespace
diff --git a/test/httptest.lua b/test/httptest.lua
index d237547..a70aa87 100644
--- a/test/httptest.lua
+++ b/test/httptest.lua
@@ -4,7 +4,6 @@
4-- to "/luasocket-test-cgi" and "/luasocket-test-cgi/" 4-- to "/luasocket-test-cgi" and "/luasocket-test-cgi/"
5-- needs "AllowOverride AuthConfig" on /home/c/diego/tec/luasocket/test/auth 5-- needs "AllowOverride AuthConfig" on /home/c/diego/tec/luasocket/test/auth
6 6
7require("luasocket")
8require("http") 7require("http")
9 8
10dofile("testsupport.lua") 9dofile("testsupport.lua")
diff --git a/test/urltest.lua b/test/urltest.lua
index 02b7077..8c2ee88 100644
--- a/test/urltest.lua
+++ b/test/urltest.lua
@@ -1,3 +1,4 @@
1require"url"
1dofile("testsupport.lua") 2dofile("testsupport.lua")
2 3
3local check_build_url = function(parsed) 4local check_build_url = function(parsed)