Commit 22e2bb48 authored by Pierre Ynard's avatar Pierre Ynard

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

In particular this happens when piping commands into stdin
parent 179cf124
...@@ -254,14 +254,14 @@ function host() ...@@ -254,14 +254,14 @@ function host()
local rclients = {} local rclients = {}
if ret > 0 then if ret > 0 then
for _, client in pairs(clients) do 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.POLLHUP)
or is_flag_set(pollfds[client:fd()], vlc.net.POLLNVAL) then or is_flag_set(pollfds[client:fd()], vlc.net.POLLNVAL) then
del_client(client) del_client(client)
elseif is_flag_set(pollfds[client:fd()], vlc.net.POLLOUT) then elseif is_flag_set(pollfds[client:fd()], vlc.net.POLLOUT) then
table.insert(wclients,client) table.insert(wclients,client)
elseif is_flag_set(pollfds[client:fd()], vlc.net.POLLIN) then
table.insert(rclients,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