[vlc-commits] lua: finish reading data from hung up client before deleting it

Pierre Ynard git at videolan.org
Sun Mar 18 04:19:49 CET 2012


vlc/vlc-2.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Mar 18 04:19:16 2012 +0100| [22e2bb48dada6e34105e3a573197cc68ae72deb6] | committer: Pierre Ynard

lua: finish reading data from hung up client before deleting it

In particular this happens when piping commands into stdin

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

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

diff --git a/share/lua/intf/modules/host.lua b/share/lua/intf/modules/host.lua
index 1627377..b350988 100644
--- a/share/lua/intf/modules/host.lua
+++ b/share/lua/intf/modules/host.lua
@@ -254,14 +254,14 @@ function host()
         local rclients = {}
         if ret > 0 then
             for _, client in pairs(clients) do
-                if is_flag_set(pollfds[client:fd()], vlc.net.POLLERR)
+                if is_flag_set(pollfds[client:fd()], vlc.net.POLLIN) then
+                    table.insert(rclients,client)
+                elseif is_flag_set(pollfds[client:fd()], vlc.net.POLLERR)
                 or is_flag_set(pollfds[client:fd()], vlc.net.POLLHUP)
                 or is_flag_set(pollfds[client:fd()], vlc.net.POLLNVAL) then
                     del_client(client)
                 elseif is_flag_set(pollfds[client:fd()], vlc.net.POLLOUT) then
                     table.insert(wclients,client)
-                elseif is_flag_set(pollfds[client:fd()], vlc.net.POLLIN) then
-                    table.insert(rclients,client)
                 end
             end
             if listeners.tcp then



More information about the vlc-commits mailing list