diff options
author | Kim Alvefur <zash@zash.se> | 2016-07-08 22:01:10 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-07-08 22:01:10 +0200 |
commit | c14840340a365a79517ff455b3e84d25ef62c159 (patch) | |
tree | e5339d0c057334591e52af0777588890d51081a5 /net | |
parent | 01e9c0fcaece58c4b70ffcb2e6f3df8e15f03f7b (diff) | |
parent | c53e625e427b1197b45ac9bbdf192cb07c6f2285 (diff) | |
download | prosody-c14840340a365a79517ff455b3e84d25ef62c159.tar.gz prosody-c14840340a365a79517ff455b3e84d25ef62c159.zip |
Merge 0.10->trunk
Diffstat (limited to 'net')
-rw-r--r-- | net/adns.lua | 1 | ||||
-rw-r--r-- | net/dns.lua | 8 | ||||
-rw-r--r-- | net/server_select.lua | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/net/adns.lua b/net/adns.lua index d3da2065..0b7247ed 100644 --- a/net/adns.lua +++ b/net/adns.lua @@ -11,7 +11,6 @@ local dns = require "net.dns"; local log = require "util.logger".init("adns"); -local t_insert, t_remove = table.insert, table.remove; local coroutine, tostring, pcall = coroutine, tostring, pcall; local function dummy_send(sock, data, i, j) return (j-i)+1; end diff --git a/net/dns.lua b/net/dns.lua index 689020a4..4a35fc1b 100644 --- a/net/dns.lua +++ b/net/dns.lua @@ -190,7 +190,7 @@ end local rrs_metatable = {}; -- - - - - - - - - - - - - - - - - - rrs_metatable function rrs_metatable.__tostring(rrs) local t = {}; - for i,rr in ipairs(rrs) do + for _, rr in ipairs(rrs) do append(t, tostring(rr)..'\n'); end return table.concat(t); @@ -841,7 +841,7 @@ function resolver:receive(rset) -- - - - - - - - - - - - - - - - - receive rset = rset or self.socket; local response; - for i,sock in pairs(rset) do + for _, sock in pairs(rset) do if self.socketset[sock] then local packet = sock:receive(); @@ -852,7 +852,7 @@ function resolver:receive(rset) -- - - - - - - - - - - - - - - - - receive --print('received response'); --self.print(response); - for j,rr in pairs(response.answer) do + for _, rr in pairs(response.answer) do if rr.name:sub(-#response.question[1].name, -1) == response.question[1].name then self:remember(rr, response.question[1].type) end @@ -894,7 +894,7 @@ function resolver:feed(sock, packet, force) --print('received response'); --self.print(response); - for j,rr in pairs(response.answer) do + for _, rr in pairs(response.answer) do self:remember(rr, response.question[1].type); end diff --git a/net/server_select.lua b/net/server_select.lua index 37d57d29..f70f81d0 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -904,7 +904,7 @@ loop = function(once) -- this is the main loop of the program end local read, write, err = socket_select( _readlist, _sendlist, math_min(_selecttimeout, next_timer_time) ) - for i, socket in ipairs( write ) do -- send data waiting in writequeues + for _, socket in ipairs( write ) do -- send data waiting in writequeues local handler = _socketlist[ socket ] if handler then handler.sendbuffer( ) @@ -913,7 +913,7 @@ loop = function(once) -- this is the main loop of the program out_put "server.lua: found no handler and closed socket (writelist)" -- this should not happen end end - for i, socket in ipairs( read ) do -- receive data + for _, socket in ipairs( read ) do -- receive data local handler = _socketlist[ socket ] if handler then handler.readbuffer( ) |