[vlc-commits] commit: lua: fix a busy loop (fix #4165) ( Rémi Duraffort )

git at videolan.org git at videolan.org
Tue Nov 9 20:14:19 CET 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Nov  9 20:13:51 2010 +0100| [a1b3978d280993a87033ee3de22b08d6dad9544f] | committer: Rémi Duraffort 

lua: fix a busy loop (fix #4165)

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

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

diff --git a/share/lua/intf/modules/host.lua b/share/lua/intf/modules/host.lua
index 46e422b..65eb993 100644
--- a/share/lua/intf/modules/host.lua
+++ b/share/lua/intf/modules/host.lua
@@ -235,6 +235,7 @@ function host()
         filter_client( pollfds, status.read, vlc.net.POLLIN )
         filter_client( pollfds, status.password, vlc.net.POLLIN )
         filter_client( pollfds, status.write, vlc.net.POLLOUT )
+
         if listeners.tcp then
             for _, listener in pairs(listeners.tcp.list) do
                 for _, fd in pairs({listener:fds()}) do
@@ -250,9 +251,10 @@ function host()
             for _, client in pairs(clients) do
                 if pollfds[client:fd()] == vlc.net.POLLOUT then
                     table.insert(wclients,client)
-                end
-                if pollfds[client:fd()] == vlc.net.POLLIN then
+                elseif pollfds[client:fd()] == vlc.net.POLLIN then
                     table.insert(rclients,client)
+                else
+                    del_client( client )
                 end
             end
             if listeners.tcp then



More information about the vlc-commits mailing list