diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-01-02 22:44:00 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-01-02 22:44:00 +0000 |
| commit | 97b26e0b66c840a446a0179200c7df23565330d1 (patch) | |
| tree | 272f9ea0451f13b563451fb8df21a03669e90d09 /src | |
| parent | a8254e94f8c14ac15b02be53a1cc69ba80899230 (diff) | |
| download | luasocket-97b26e0b66c840a446a0179200c7df23565330d1.tar.gz luasocket-97b26e0b66c840a446a0179200c7df23565330d1.tar.bz2 luasocket-97b26e0b66c840a446a0179200c7df23565330d1.zip | |
Almost ready to release beta3
Diffstat (limited to 'src')
| -rw-r--r-- | src/ftp.lua | 2 | ||||
| -rw-r--r-- | src/http.lua | 2 | ||||
| -rw-r--r-- | src/ltn12.lua | 22 | ||||
| -rw-r--r-- | src/luasocket.h | 4 | ||||
| -rw-r--r-- | src/mime.lua | 2 | ||||
| -rw-r--r-- | src/smtp.lua | 2 | ||||
| -rw-r--r-- | src/socket.lua | 2 | ||||
| -rw-r--r-- | src/tp.lua | 2 | ||||
| -rw-r--r-- | src/url.lua | 2 |
9 files changed, 19 insertions, 21 deletions
diff --git a/src/ftp.lua b/src/ftp.lua index c55ec4e..9b7c1e5 100644 --- a/src/ftp.lua +++ b/src/ftp.lua | |||
| @@ -278,4 +278,4 @@ get = socket.protect(function(gett) | |||
| 278 | else return tget(gett) end | 278 | else return tget(gett) end |
| 279 | end) | 279 | end) |
| 280 | 280 | ||
| 281 | getmetatable(_M).__index = nil | 281 | --getmetatable(_M).__index = nil |
diff --git a/src/http.lua b/src/http.lua index 27ce960..5fb59ce 100644 --- a/src/http.lua +++ b/src/http.lua | |||
| @@ -259,4 +259,4 @@ request = socket.protect(function(reqt, body) | |||
| 259 | else return trequest(reqt) end | 259 | else return trequest(reqt) end |
| 260 | end) | 260 | end) |
| 261 | 261 | ||
| 262 | getmetatable(_M).__index = nil | 262 | --getmetatable(_M).__index = nil |
diff --git a/src/ltn12.lua b/src/ltn12.lua index 813e7d6..8c80196 100644 --- a/src/ltn12.lua +++ b/src/ltn12.lua | |||
| @@ -170,20 +170,16 @@ end | |||
| 170 | 170 | ||
| 171 | -- creates a source that produces contents of several sources, one after the | 171 | -- creates a source that produces contents of several sources, one after the |
| 172 | -- other, as if they were concatenated | 172 | -- other, as if they were concatenated |
| 173 | -- (thanks to Wim Couwenberg) | ||
| 173 | function source.cat(...) | 174 | function source.cat(...) |
| 174 | local co = coroutine.create(function() | 175 | local src = table.remove(arg, 1) |
| 175 | local i = 1 | ||
| 176 | while i <= table.getn(arg) do | ||
| 177 | local chunk, err = arg[i]() | ||
| 178 | if chunk then coroutine.yield(chunk) | ||
| 179 | elseif err then return nil, err | ||
| 180 | else i = i + 1 end | ||
| 181 | end | ||
| 182 | end) | ||
| 183 | return function() | 176 | return function() |
| 184 | local ret, a, b = coroutine.resume(co) | 177 | while src do |
| 185 | if ret then return a, b | 178 | local chunk, err = src() |
| 186 | else return nil, a end | 179 | if chunk then return chunk end |
| 180 | if err then return nil, err end | ||
| 181 | src = table.remove(arg, 1) | ||
| 182 | end | ||
| 187 | end | 183 | end |
| 188 | end | 184 | end |
| 189 | 185 | ||
| @@ -276,4 +272,4 @@ function pump.all(src, snk, step) | |||
| 276 | end | 272 | end |
| 277 | end | 273 | end |
| 278 | 274 | ||
| 279 | getmetatable(_M).__index = nil | 275 | --getmetatable(_M).__index = nil |
diff --git a/src/luasocket.h b/src/luasocket.h index 33524e3..db54a18 100644 --- a/src/luasocket.h +++ b/src/luasocket.h | |||
| @@ -13,7 +13,9 @@ | |||
| 13 | /*-------------------------------------------------------------------------*\ | 13 | /*-------------------------------------------------------------------------*\ |
| 14 | * Current luasocket version | 14 | * Current luasocket version |
| 15 | \*-------------------------------------------------------------------------*/ | 15 | \*-------------------------------------------------------------------------*/ |
| 16 | #define LUASOCKET_VERSION "LuaSocket 2.0 (beta3)" | 16 | #define LUASOCKET_VERSION "LuaSocket 2.0 (beta3)" |
| 17 | #define LUASOCKET_COPYRIGHT "Copyright (C) 2004-2005 Diego Nehab" | ||
| 18 | #define LUASOCKET_AUTHORS "Diego Nehab" | ||
| 17 | 19 | ||
| 18 | /*-------------------------------------------------------------------------*\ | 20 | /*-------------------------------------------------------------------------*\ |
| 19 | * This macro prefixes all exported API functions | 21 | * This macro prefixes all exported API functions |
diff --git a/src/mime.lua b/src/mime.lua index 71efdb3..4d5bdba 100644 --- a/src/mime.lua +++ b/src/mime.lua | |||
| @@ -85,4 +85,4 @@ function mime.stuff() | |||
| 85 | return ltn12.filter.cycle(dot, 2) | 85 | return ltn12.filter.cycle(dot, 2) |
| 86 | end | 86 | end |
| 87 | 87 | ||
| 88 | getmetatable(_M).__index = nil | 88 | --getmetatable(_M).__index = nil |
diff --git a/src/smtp.lua b/src/smtp.lua index 6281544..12c2195 100644 --- a/src/smtp.lua +++ b/src/smtp.lua | |||
| @@ -245,4 +245,4 @@ send = socket.protect(function(mailt) | |||
| 245 | return s:close() | 245 | return s:close() |
| 246 | end) | 246 | end) |
| 247 | 247 | ||
| 248 | getmetatable(_M).__index = nil | 248 | --getmetatable(_M).__index = nil |
diff --git a/src/socket.lua b/src/socket.lua index 57619fa..e3c85f0 100644 --- a/src/socket.lua +++ b/src/socket.lua | |||
| @@ -172,4 +172,4 @@ socket.sourcet["default"] = socket.sourcet["until-closed"] | |||
| 172 | 172 | ||
| 173 | socket.source = socket.choose(socket.sourcet) | 173 | socket.source = socket.choose(socket.sourcet) |
| 174 | 174 | ||
| 175 | getmetatable(_M).__index = nil | 175 | --getmetatable(_M).__index = nil |
| @@ -120,4 +120,4 @@ function connect(host, port, timeout) | |||
| 120 | return base.setmetatable({c = c}, metat) | 120 | return base.setmetatable({c = c}, metat) |
| 121 | end | 121 | end |
| 122 | 122 | ||
| 123 | getmetatable(_M).__index = nil | 123 | --getmetatable(_M).__index = nil |
diff --git a/src/url.lua b/src/url.lua index e6132f8..8d7b88f 100644 --- a/src/url.lua +++ b/src/url.lua | |||
| @@ -273,4 +273,4 @@ function build_path(parsed, unsafe) | |||
| 273 | return path | 273 | return path |
| 274 | end | 274 | end |
| 275 | 275 | ||
| 276 | getmetatable(_M).__index = nil | 276 | --getmetatable(_M).__index = nil |
