Commit 6f7ee22f authored by Pierre Ynard's avatar Pierre Ynard

luatelnet: end remotely closed connections

Fix a busy loop and socket leak
(cherry picked from commit d16bdb968e2d1ef40e1cc109b79a4a0f3322b61f)
Signed-off-by: default avatarPierre Ynard <linkfanel@yahoo.fr>
parent 0f68ddf8
......@@ -183,13 +183,10 @@ while not vlc.misc.should_die() do
for _, client in pairs(r) do
local str = client.cmds .. client:recv(1000)
if not str then -- the telnet client program has left
client.cmds = "quit\n"
elseif string.match(str,"\n") then
if string.match(str,"\n") then
client.cmds = str
elseif client.buffer == ""
and ((client.type == host.client_type.stdio and str == "")
or (client.type == host.client_type.net and str == "\004")) then
elseif not str or str == "" -- the telnet client program has left
or (client.type == host.client_type.net and str == "\004") then
-- Caught a ^D
client.cmds = "quit\n"
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment