mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-25 02:09:58 +02:00
Almost ready to release beta3
This commit is contained in:
@ -278,4 +278,4 @@ get = socket.protect(function(gett)
|
||||
else return tget(gett) end
|
||||
end)
|
||||
|
||||
getmetatable(_M).__index = nil
|
||||
--getmetatable(_M).__index = nil
|
||||
|
@ -259,4 +259,4 @@ request = socket.protect(function(reqt, body)
|
||||
else return trequest(reqt) end
|
||||
end)
|
||||
|
||||
getmetatable(_M).__index = nil
|
||||
--getmetatable(_M).__index = nil
|
||||
|
@ -170,20 +170,16 @@ end
|
||||
|
||||
-- creates a source that produces contents of several sources, one after the
|
||||
-- other, as if they were concatenated
|
||||
-- (thanks to Wim Couwenberg)
|
||||
function source.cat(...)
|
||||
local co = coroutine.create(function()
|
||||
local i = 1
|
||||
while i <= table.getn(arg) do
|
||||
local chunk, err = arg[i]()
|
||||
if chunk then coroutine.yield(chunk)
|
||||
elseif err then return nil, err
|
||||
else i = i + 1 end
|
||||
end
|
||||
end)
|
||||
local src = table.remove(arg, 1)
|
||||
return function()
|
||||
local ret, a, b = coroutine.resume(co)
|
||||
if ret then return a, b
|
||||
else return nil, a end
|
||||
while src do
|
||||
local chunk, err = src()
|
||||
if chunk then return chunk end
|
||||
if err then return nil, err end
|
||||
src = table.remove(arg, 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -276,4 +272,4 @@ function pump.all(src, snk, step)
|
||||
end
|
||||
end
|
||||
|
||||
getmetatable(_M).__index = nil
|
||||
--getmetatable(_M).__index = nil
|
||||
|
@ -13,7 +13,9 @@
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* Current luasocket version
|
||||
\*-------------------------------------------------------------------------*/
|
||||
#define LUASOCKET_VERSION "LuaSocket 2.0 (beta3)"
|
||||
#define LUASOCKET_VERSION "LuaSocket 2.0 (beta3)"
|
||||
#define LUASOCKET_COPYRIGHT "Copyright (C) 2004-2005 Diego Nehab"
|
||||
#define LUASOCKET_AUTHORS "Diego Nehab"
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* This macro prefixes all exported API functions
|
||||
|
@ -85,4 +85,4 @@ function mime.stuff()
|
||||
return ltn12.filter.cycle(dot, 2)
|
||||
end
|
||||
|
||||
getmetatable(_M).__index = nil
|
||||
--getmetatable(_M).__index = nil
|
||||
|
@ -245,4 +245,4 @@ send = socket.protect(function(mailt)
|
||||
return s:close()
|
||||
end)
|
||||
|
||||
getmetatable(_M).__index = nil
|
||||
--getmetatable(_M).__index = nil
|
||||
|
@ -172,4 +172,4 @@ socket.sourcet["default"] = socket.sourcet["until-closed"]
|
||||
|
||||
socket.source = socket.choose(socket.sourcet)
|
||||
|
||||
getmetatable(_M).__index = nil
|
||||
--getmetatable(_M).__index = nil
|
||||
|
@ -120,4 +120,4 @@ function connect(host, port, timeout)
|
||||
return base.setmetatable({c = c}, metat)
|
||||
end
|
||||
|
||||
getmetatable(_M).__index = nil
|
||||
--getmetatable(_M).__index = nil
|
||||
|
@ -273,4 +273,4 @@ function build_path(parsed, unsafe)
|
||||
return path
|
||||
end
|
||||
|
||||
getmetatable(_M).__index = nil
|
||||
--getmetatable(_M).__index = nil
|
||||
|
Reference in New Issue
Block a user