Commit 8f47014f authored by Pierre Ynard's avatar Pierre Ynard

luatelnet: fix input reading

This fixes problems with lost characters and failure to close
connections in some cases
(cherry picked from commit 1b76f4d5b6e247ebc1f3f1786c99eef1f0510c73)
Signed-off-by: default avatarPierre Ynard <linkfanel@yahoo.fr>
parent ca5c8120
......@@ -181,14 +181,14 @@ while not vlc.misc.should_die() do
-- Handle reads
for _, client in pairs(r) do
local str = client.cmds .. client:recv(1000)
local str = client:recv(1000)
if string.match(str,"\n") then
client.cmds = str
elseif not str or str == "" -- the telnet client program has left
if 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"
else
client.cmds = client.cmds .. str
end
client.buffer = ""
......
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