From: RĂ©mi Duraffort Date: Thu, 1 Apr 2010 20:26:43 +0000 (+0200) Subject: Lua_telnet: if the telnet client program quit, close the connection correctly. X-Git-Tag: 1.1.0-pre1~142 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=52b39f923deb31a758f3ed8f485bfa9ba075aa97;p=vlc Lua_telnet: if the telnet client program quit, close the connection correctly. --- diff --git a/share/lua/intf/telnet.lua b/share/lua/intf/telnet.lua index a529b07ef5..89a478669c 100644 --- a/share/lua/intf/telnet.lua +++ b/share/lua/intf/telnet.lua @@ -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 == ""