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

Pierre Ynard git at videolan.org
Sat Mar 17 22:40:52 CET 2012


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Mar 17 22:36:31 2012 +0100| [ccaf5b8de94a5730665b83ebb8baf632b1ec1814] | 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.git/?a=commit;h=ccaf5b8de94a5730665b83ebb8baf632b1ec1814
---

 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 b0332c6..0d299cb 100644
--- a/share/lua/intf/modules/host.lua
+++ b/share/lua/intf/modules/host.lua
@@ -278,14 +278,14 @@ function host()
             local ret = vlc.net.poll( pollfds )
             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
                         client:del()
                     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