aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-28 06:16:43 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-28 06:16:43 +0000
commit694edcc3c1ac3041ff8cdd753a2f7894e8783e6c (patch)
treef8797b4c7671fbf9042fc011277d69d4c3549045 /etc
parentbf738a03368b8de9c574d9631f131c5a520acf7b (diff)
downloadluasocket-694edcc3c1ac3041ff8cdd753a2f7894e8783e6c.tar.gz
luasocket-694edcc3c1ac3041ff8cdd753a2f7894e8783e6c.tar.bz2
luasocket-694edcc3c1ac3041ff8cdd753a2f7894e8783e6c.zip
Committing with require.
Diffstat (limited to 'etc')
-rw-r--r--etc/b64.lua2
-rw-r--r--etc/dict.lua5
2 files changed, 4 insertions, 3 deletions
diff --git a/etc/b64.lua b/etc/b64.lua
index 3f861b4..1993b01 100644
--- a/etc/b64.lua
+++ b/etc/b64.lua
@@ -1,3 +1,5 @@
1require("ltn12")
2require("mime")
1local source = ltn12.source.file(io.stdin) 3local source = ltn12.source.file(io.stdin)
2local sink = ltn12.sink.file(io.stdout) 4local sink = ltn12.sink.file(io.stdout)
3local convert 5local convert
diff --git a/etc/dict.lua b/etc/dict.lua
index 933c1c8..d11ac93 100644
--- a/etc/dict.lua
+++ b/etc/dict.lua
@@ -8,12 +8,11 @@ function get_status(sock, valid)
8 local line, err = sock:receive() 8 local line, err = sock:receive()
9 local code, par 9 local code, par
10 if not line then sock:close() return err end 10 if not line then sock:close() return err end
11 _, _, code = string.find(line, "^(%d%d%d)") 11 code = socket.skip(2, string.find(line, "^(%d%d%d)"))
12 code = tonumber(code) 12 code = tonumber(code)
13 if code ~= valid then return code end 13 if code ~= valid then return code end
14 if code == 150 then 14 if code == 150 then
15 _,_,_, par = string.find(line, "^(%d%d%d) (%d*)") 15 par = tonumber(socket.skip(2, string.find(line, "^%d%d%d (%d*)"))
16 par = tonumber(par)
17 end 16 end
18 return nil, par 17 return nil, par
19end 18end