aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ftp.lua2
-rw-r--r--src/http.lua2
-rw-r--r--src/ltn12.lua22
-rw-r--r--src/luasocket.h4
-rw-r--r--src/mime.lua2
-rw-r--r--src/smtp.lua2
-rw-r--r--src/socket.lua2
-rw-r--r--src/tp.lua2
-rw-r--r--src/url.lua2
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
279end) 279end)
280 280
281getmetatable(_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
260end) 260end)
261 261
262getmetatable(_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)
173function source.cat(...) 174function 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
188end 184end
189 185
@@ -276,4 +272,4 @@ function pump.all(src, snk, step)
276 end 272 end
277end 273end
278 274
279getmetatable(_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)
86end 86end
87 87
88getmetatable(_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()
246end) 246end)
247 247
248getmetatable(_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
173socket.source = socket.choose(socket.sourcet) 173socket.source = socket.choose(socket.sourcet)
174 174
175getmetatable(_M).__index = nil 175--getmetatable(_M).__index = nil
diff --git a/src/tp.lua b/src/tp.lua
index 085cc2b..1adc656 100644
--- a/src/tp.lua
+++ b/src/tp.lua
@@ -120,4 +120,4 @@ function connect(host, port, timeout)
120 return base.setmetatable({c = c}, metat) 120 return base.setmetatable({c = c}, metat)
121end 121end
122 122
123getmetatable(_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
274end 274end
275 275
276getmetatable(_M).__index = nil 276--getmetatable(_M).__index = nil