mirror of
https://github.com/ShadowNinja/LuaIRC.git
synced 2025-01-09 17:40:29 +01:00
Merge remote branch 'jacop/ssl'
Conflicts: asyncoperations.lua
This commit is contained in:
commit
01ffa79347
@ -7,11 +7,7 @@ local meta = _META
|
||||
function meta:send(fmt, ...)
|
||||
local bytes, err = self.socket:send(fmt:format(...) .. "\r\n")
|
||||
|
||||
if bytes then
|
||||
return
|
||||
end
|
||||
|
||||
if err ~= "timeout" and err ~= "wantwrite" then
|
||||
if not bytes and err ~= "timeout" and err ~= "wantwrite" then
|
||||
self:invoke("OnDisconnect", err, true)
|
||||
self:shutdown()
|
||||
error(err, errlevel)
|
||||
@ -73,12 +69,12 @@ function meta:setMode(t)
|
||||
assert(add or rem, "table contains neither 'add' nor 'remove'")
|
||||
|
||||
if add then
|
||||
mode = table.concat{"+", add}
|
||||
mode = table.concat{"+", verify(add, 3)}
|
||||
end
|
||||
|
||||
if rem then
|
||||
mode = table.concat{mode, "-", rem}
|
||||
mode = table.concat{mode, "-", verify(rem, 3)}
|
||||
end
|
||||
|
||||
self:send("MODE %s %s", verify(target, 3), verify(mode, 3))
|
||||
self:send("MODE %s %s", verify(target, 3), mode)
|
||||
end
|
||||
|
5
init.lua
5
init.lua
@ -109,7 +109,7 @@ function meta_preconnect:connect(_host, _port)
|
||||
s = ssl.wrap(s, params)
|
||||
success, errmsg = s:dohandshake()
|
||||
if not success then
|
||||
error(("could not make secure connection %s"):format(errmsg), 2)
|
||||
error(("could not make secure connection: %s"):format(errmsg), 2)
|
||||
end
|
||||
end
|
||||
|
||||
@ -133,7 +133,7 @@ function meta_preconnect:connect(_host, _port)
|
||||
end
|
||||
|
||||
function meta:disconnect(message)
|
||||
local message = message or "Bye!"
|
||||
message = message or "Bye!"
|
||||
|
||||
self:invoke("OnDisconnect", message, false)
|
||||
self:send("QUIT :%s", message)
|
||||
@ -352,3 +352,4 @@ end
|
||||
function meta:topic(channel)
|
||||
self:send("TOPIC %s", channel)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user