Commit d16bdb96 authored by Pierre Ynard's avatar Pierre Ynard

luatelnet: end remotely closed connections

Fix a busy loop and socket leak
parent 90000056
......@@ -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