1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-11-23 02:28:05 +11:00

Merge pull request #36 from Hawk777/fix-listeners-deregistering

Do not unregister listeners on unexpected data
This commit is contained in:
Izaya 2023-07-27 10:08:33 +10:00 committed by GitHub
commit f8903ad587
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,15 +69,15 @@ local function wentry(_,msg,level,service,host)
end end
local function remote_listener(_,from,port,data) local function remote_listener(_,from,port,data)
if port ~= cfg.port then return false end if port ~= cfg.port then return end
local service, level, msg = data:match("(.-)\t(%d)\t(.+)") local service, level, msg = data:match("(.-)\t(%d)\t(.+)")
if not service or not level or not msg then return false end if not service or not level or not msg then return end
msg, level, service = tostring(msg),tonumber(level),tostring(service) msg, level, service = tostring(msg),tonumber(level),tostring(service)
wentry(nil,msg,level,service,from) wentry(nil,msg,level,service,from)
end end
local function local_listener(_,msg,level,service) local function local_listener(_,msg,level,service)
if not service or not level or not msg then return false end if not service or not level or not msg then return end
msg, level, service = tostring(msg),tonumber(level),tostring(service) msg, level, service = tostring(msg),tonumber(level),tostring(service)
wentry(nil,msg,level,service,hostname) wentry(nil,msg,level,service,hostname)
end end