1
0
mirror of https://github.com/ShadowNinja/LuaIRC.git synced 2024-09-28 15:30:34 +02:00

Cleaning up getline function

This commit is contained in:
Joshua Simmons 2010-07-21 01:12:31 +10:00
parent d3c6ab849b
commit ca767c8b42

View File

@ -149,15 +149,13 @@ end
local function getline(self, errlevel) local function getline(self, errlevel)
local line, err = self.socket:receive("*l") local line, err = self.socket:receive("*l")
if line then if not line and err ~= "timeout" and err ~= "wantread" then
return line
end
if err ~= "timeout" and err ~= "wantread" then
self:invoke("OnDisconnect", err, true) self:invoke("OnDisconnect", err, true)
self:shutdown() self:shutdown()
error(err, errlevel) error(err, errlevel)
end end
return line
end end
function meta:think() function meta:think()