removed 2 locals, fixed http
This commit is contained in:
parent
9016e91238
commit
8bc5ba604e
3 changed files with 13 additions and 6 deletions
|
@ -114,9 +114,12 @@ function metat.__index:send(mailt)
|
|||
end
|
||||
|
||||
function _M.open(mailt)
|
||||
local c = function() return mailt:create() end -- wrap to do a method call
|
||||
local tp = socket.try(tp.connect(mailt.server or _M.SERVER, mailt.port or _M.PORT,
|
||||
_M.TIMEOUT, c))
|
||||
local tp = socket.try(tp.connect(
|
||||
mailt.server or _M.SERVER,
|
||||
mailt.port or _M.PORT,
|
||||
_M.TIMEOUT,
|
||||
function() return mailt:create() end -- wrap to do a method call
|
||||
))
|
||||
local s = base.setmetatable({tp = tp}, metat)
|
||||
-- make sure tp is closed if we get an exception
|
||||
s.try = socket.newtry(function()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue