mirror of
https://github.com/ShadowNinja/LuaIRC.git
synced 2025-01-09 17:40:29 +01:00
Cleaning up getline function
This commit is contained in:
parent
d3c6ab849b
commit
ca767c8b42
8
init.lua
8
init.lua
@ -149,15 +149,13 @@ end
|
||||
local function getline(self, errlevel)
|
||||
local line, err = self.socket:receive("*l")
|
||||
|
||||
if line then
|
||||
return line
|
||||
end
|
||||
|
||||
if err ~= "timeout" and err ~= "wantread" then
|
||||
if not line and err ~= "timeout" and err ~= "wantread" then
|
||||
self:invoke("OnDisconnect", err, true)
|
||||
self:shutdown()
|
||||
error(err, errlevel)
|
||||
end
|
||||
|
||||
return line
|
||||
end
|
||||
|
||||
function meta:think()
|
||||
|
Loading…
Reference in New Issue
Block a user