Commit ccaf5b8d 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 de0bf007
......@@ -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
......
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