mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-20 15:59:48 +02:00
Manual is almost done. HTTP is missing.
Implemented new distribution scheme. Select is now purely C. HTTP reimplemented seems faster dunno why. LTN12 functions that coroutines fail gracefully.
This commit is contained in:
14
src/mime.lua
14
src/mime.lua
@ -5,24 +5,16 @@
|
||||
-- RCS ID: $Id$
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Load MIME from dynamic library
|
||||
-- Comment these lines if you are loading static
|
||||
-----------------------------------------------------------------------------
|
||||
local open = assert(loadlib("mime", "luaopen_mime"))
|
||||
local mime = assert(open())
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Load other required modules
|
||||
-----------------------------------------------------------------------------
|
||||
local mime = requirelib("mime", "luaopen_mime", getfenv(1))
|
||||
local ltn12 = require("ltn12")
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Setup namespace
|
||||
-----------------------------------------------------------------------------
|
||||
-- make all module globals fall into mime namespace
|
||||
setmetatable(mime, { __index = _G })
|
||||
setfenv(1, mime)
|
||||
_LOADED["mime"] = mime
|
||||
|
||||
-- encode, decode and wrap algorithm tables
|
||||
encodet = {}
|
||||
@ -48,7 +40,7 @@ end
|
||||
|
||||
encodet['quoted-printable'] = function(mode)
|
||||
return ltn12.filter.cycle(qp, "",
|
||||
(mode == "binary") and "=0D=0A" or "\13\10")
|
||||
(mode == "binary") and "=0D=0A" or "\r\n")
|
||||
end
|
||||
|
||||
-- define the decoding filters
|
||||
|
Reference in New Issue
Block a user