Commit 52b39f92 authored by Rémi Duraffort's avatar Rémi Duraffort

Lua_telnet: if the telnet client program quit, close the connection correctly.

parent 7eb7f15b
......@@ -185,7 +185,10 @@ while not vlc.misc.should_die() do
for _, client in pairs(r) do
local str = client:recv(1000)
local done = false
if string.match(str,"\n$") then
if not str then -- the telnet client program has leave
client.buffer = "quit"
done = true
elseif string.match(str,"\n$") then
client.buffer = string.gsub(client.buffer..str,"\r?\n$","")
done = true
elseif 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