aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-02-11 03:31:53 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-02-11 03:31:53 +0000
commit390846b640ee7013d51a766b4b2472bdcfbbdfcc (patch)
tree3bedd023a0a84feb714615245b58eab5ffb4309b /etc
parent0b2542d1a61fc5425ff65ab3dbf7ba7de174763f (diff)
downloadluasocket-390846b640ee7013d51a766b4b2472bdcfbbdfcc.tar.gz
luasocket-390846b640ee7013d51a766b4b2472bdcfbbdfcc.tar.bz2
luasocket-390846b640ee7013d51a766b4b2472bdcfbbdfcc.zip
Added ltn12 module. Modified mime to be stand alone.
Still crashes on invalid input. Dunno why.
Diffstat (limited to 'etc')
-rw-r--r--etc/eol.lua4
-rw-r--r--etc/qp.lua4
2 files changed, 4 insertions, 4 deletions
diff --git a/etc/eol.lua b/etc/eol.lua
index fea5da9..6b2a8a9 100644
--- a/etc/eol.lua
+++ b/etc/eol.lua
@@ -1,9 +1,9 @@
1marker = {['-u'] = '\10', ['-d'] = '\13\10'} 1marker = {['-u'] = '\10', ['-d'] = '\13\10'}
2arg = arg or {'-u'} 2arg = arg or {'-u'}
3marker = marker[arg[1]] or marker['-u'] 3marker = marker[arg[1]] or marker['-u']
4local convert = socket.mime.canonic(marker) 4local convert = socket.mime.normalize(marker)
5while 1 do 5while 1 do
6 local chunk = io.read(4096) 6 local chunk = io.read(1)
7 io.write(convert(chunk)) 7 io.write(convert(chunk))
8 if not chunk then break end 8 if not chunk then break end
9end 9end
diff --git a/etc/qp.lua b/etc/qp.lua
index 23c834a..1ca0ae2 100644
--- a/etc/qp.lua
+++ b/etc/qp.lua
@@ -2,10 +2,10 @@ local convert
2arg = arg or {} 2arg = arg or {}
3local mode = arg and arg[1] or "-et" 3local mode = arg and arg[1] or "-et"
4if mode == "-et" then 4if mode == "-et" then
5 local canonic = socket.mime.canonic() 5 local normalize = socket.mime.normalize()
6 local qp = socket.mime.encode("quoted-printable") 6 local qp = socket.mime.encode("quoted-printable")
7 local wrap = socket.mime.wrap("quoted-printable") 7 local wrap = socket.mime.wrap("quoted-printable")
8 convert = socket.mime.chain(canonic, qp, wrap) 8 convert = socket.mime.chain(normalize, qp, wrap)
9elseif mode == "-eb" then 9elseif mode == "-eb" then
10 local qp = socket.mime.encode("quoted-printable", "binary") 10 local qp = socket.mime.encode("quoted-printable", "binary")
11 local wrap = socket.mime.wrap("quoted-printable") 11 local wrap = socket.mime.wrap("quoted-printable")