Commit a1b3978d authored by Rémi Duraffort's avatar Rémi Duraffort

lua: fix a busy loop (fix #4165)

parent 2fd5851a
...@@ -235,6 +235,7 @@ function host() ...@@ -235,6 +235,7 @@ function host()
filter_client( pollfds, status.read, vlc.net.POLLIN ) filter_client( pollfds, status.read, vlc.net.POLLIN )
filter_client( pollfds, status.password, vlc.net.POLLIN ) filter_client( pollfds, status.password, vlc.net.POLLIN )
filter_client( pollfds, status.write, vlc.net.POLLOUT ) filter_client( pollfds, status.write, vlc.net.POLLOUT )
if listeners.tcp then if listeners.tcp then
for _, listener in pairs(listeners.tcp.list) do for _, listener in pairs(listeners.tcp.list) do
for _, fd in pairs({listener:fds()}) do for _, fd in pairs({listener:fds()}) do
...@@ -250,9 +251,10 @@ function host() ...@@ -250,9 +251,10 @@ function host()
for _, client in pairs(clients) do for _, client in pairs(clients) do
if pollfds[client:fd()] == vlc.net.POLLOUT then if pollfds[client:fd()] == vlc.net.POLLOUT then
table.insert(wclients,client) table.insert(wclients,client)
end elseif pollfds[client:fd()] == vlc.net.POLLIN then
if pollfds[client:fd()] == vlc.net.POLLIN then
table.insert(rclients,client) table.insert(rclients,client)
else
del_client( client )
end end
end end
if listeners.tcp then if listeners.tcp then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment