aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-28 07:24:43 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-28 07:24:43 +0000
commitc98dc991998c724a3f6a1fdd90b5d1d8a80e3af3 (patch)
tree8d8b8aa856d8a3e822121d0915a63b8244f471bb /etc
parent9297b074d53a00e1149250e0bbfa0871dcc5558f (diff)
downloadluasocket-c98dc991998c724a3f6a1fdd90b5d1d8a80e3af3.tar.gz
luasocket-c98dc991998c724a3f6a1fdd90b5d1d8a80e3af3.tar.bz2
luasocket-c98dc991998c724a3f6a1fdd90b5d1d8a80e3af3.zip
Bug feioso no UDP e possivelmente no TCP também.
Diffstat (limited to 'etc')
-rw-r--r--etc/b64.lua4
-rw-r--r--etc/check-links.lua4
-rw-r--r--etc/dict.lua4
-rw-r--r--etc/qp.lua4
4 files changed, 12 insertions, 4 deletions
diff --git a/etc/b64.lua b/etc/b64.lua
index 1993b01..b86b870 100644
--- a/etc/b64.lua
+++ b/etc/b64.lua
@@ -10,5 +10,5 @@ else
10 local wrap = mime.wrap() 10 local wrap = mime.wrap()
11 convert = ltn12.filter.chain(base64, wrap) 11 convert = ltn12.filter.chain(base64, wrap)
12end 12end
13source = ltn12.source.chain(source, convert) 13sink = ltn12.sink.chain(convert, sink)
14repeat until not ltn12.pump(source, sink) 14ltn12.pump.all(source, sink)
diff --git a/etc/check-links.lua b/etc/check-links.lua
index 03ca6de..c200dfb 100644
--- a/etc/check-links.lua
+++ b/etc/check-links.lua
@@ -4,6 +4,10 @@
4-- Author: Diego Nehab 4-- Author: Diego Nehab
5-- RCS ID: $Id$ 5-- RCS ID: $Id$
6----------------------------------------------------------------------------- 6-----------------------------------------------------------------------------
7
8require"luasocket"
9require"http"
10
7socket.http.TIMEOUT = 10 11socket.http.TIMEOUT = 10
8 12
9cache = {} 13cache = {}
diff --git a/etc/dict.lua b/etc/dict.lua
index d11ac93..31359d9 100644
--- a/etc/dict.lua
+++ b/etc/dict.lua
@@ -4,6 +4,8 @@
4-- Author: Diego Nehab 4-- Author: Diego Nehab
5-- RCS ID: $Id$ 5-- RCS ID: $Id$
6----------------------------------------------------------------------------- 6-----------------------------------------------------------------------------
7require"luasocket"
8
7function get_status(sock, valid) 9function get_status(sock, valid)
8 local line, err = sock:receive() 10 local line, err = sock:receive()
9 local code, par 11 local code, par
@@ -12,7 +14,7 @@ function get_status(sock, valid)
12 code = tonumber(code) 14 code = tonumber(code)
13 if code ~= valid then return code end 15 if code ~= valid then return code end
14 if code == 150 then 16 if code == 150 then
15 par = tonumber(socket.skip(2, string.find(line, "^%d%d%d (%d*)")) 17 par = tonumber(socket.skip(2, string.find(line, "^%d%d%d (%d*)")))
16 end 18 end
17 return nil, par 19 return nil, par
18end 20end
diff --git a/etc/qp.lua b/etc/qp.lua
index 08545db..5a00c4d 100644
--- a/etc/qp.lua
+++ b/etc/qp.lua
@@ -1,3 +1,5 @@
1require("ltn12")
2require("mime")
1local convert 3local convert
2arg = arg or {} 4arg = arg or {}
3local mode = arg and arg[1] or "-et" 5local mode = arg and arg[1] or "-et"
@@ -13,4 +15,4 @@ elseif mode == "-eb" then
13else convert = mime.decode("quoted-printable") end 15else convert = mime.decode("quoted-printable") end
14local source = ltn12.source.chain(ltn12.source.file(io.stdin), convert) 16local source = ltn12.source.chain(ltn12.source.file(io.stdin), convert)
15local sink = ltn12.sink.file(io.stdout) 17local sink = ltn12.sink.file(io.stdout)
16ltn12.pump(source, sink) 18ltn12.pump.all(source, sink)