mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-11-19 11:48:21 +01:00
5b8d7dec54
Update get.lua to use the new callbacks. The old "code" module is now the "mime" module. Updated all modules that depended on it. Updated url.lua to use the new namespace scheme, and moved the escape and unescape functions that used to be in the code.lua module to it, since these are specific to urls. Updated the callback entries in the manual.
10 lines
257 B
Lua
10 lines
257 B
Lua
marker = {['-u'] = '\10', ['-d'] = '\13\10'}
|
|
arg = arg or {'-u'}
|
|
marker = marker[arg[1]] or marker['-u']
|
|
local convert = socket.mime.canonic(marker)
|
|
while 1 do
|
|
local chunk = io.read(4096)
|
|
io.write(convert(chunk))
|
|
if not chunk then break end
|
|
end
|