[vlc-commits] lua: do delete stdin/stdout client

Pierre Ynard git at videolan.org
Sun Mar 18 04:31:39 CET 2012


vlc/vlc-2.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Mar 18 04:31:20 2012 +0100| [4f1cfa6dc742a365fe1f9f5e113def9446ea812e] | committer: Pierre Ynard

lua: do delete stdin/stdout client

This fixes an endless loop when piping commands to stdin with echo
for example

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=4f1cfa6dc742a365fe1f9f5e113def9446ea812e
---

 share/lua/intf/modules/host.lua |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/share/lua/intf/modules/host.lua b/share/lua/intf/modules/host.lua
index b350988..bdd45d7 100644
--- a/share/lua/intf/modules/host.lua
+++ b/share/lua/intf/modules/host.lua
@@ -115,13 +115,13 @@ function host()
     end
 
     local function del_client( client )
-        if client.type == client_type.stdio then
-            client:send( "Cannot delete stdin/stdout client.\n" )
-            return
-        end
         for i, c in pairs(clients) do
             if c == client then
-                if client.type == client_type.net
+                if client.type == client_type.stdio then
+                    h:broadcast("Shutting down.\r\n")
+                    vlc.msg.info("Requested shutdown.")
+                    vlc.misc.quit()
+                elseif client.type == client_type.net
                 or client.type == client_type.telnet then
                     if client.wfd ~= client.rfd then
                         vlc.net.close( client.rfd )



More information about the vlc-commits mailing list