mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 04:32:30 +00:00
input: survive controlling-terminal/pty hangup on stdin
Since the 0.16.13 callback/poll rework, an EPOLLERR on stdin (controlling
terminal or pty hangup) reaches Poll::process(), which aborts the whole
client with an internal_error because InputEvent never registered for error
events:
Poll::process() received error event for event not in error: input-fd:0
Register stdin for error events (insert_error) and handle event_error() by
dropping stdin from the poll set with this_thread::poll()->remove_and_close().
rtorrent then keeps running without keyboard input instead of dying.
remove() guards on the fd state (is_open()), mirroring SCgiTask: event_error()
clears the fd after remove_and_close(), and the shutdown path (Control::cleanup)
still calls remove(); without the guard the second remove_and_close() throws
'event not found' via event_mask(). insert()/remove() take the thread poll
implicitly (this_thread::poll()) instead of a Poll* argument.
This commit is contained in:
committed by
Jari Sundell
parent
acb02379b8
commit
c6de871a77
+2
-2
@@ -76,7 +76,7 @@ Control::initialize() {
|
||||
m_ui->init(this);
|
||||
|
||||
if(!display::Canvas::daemon())
|
||||
m_inputStdin->insert(torrent::this_thread::poll());
|
||||
m_inputStdin->insert();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -86,7 +86,7 @@ Control::cleanup() {
|
||||
torrent::this_thread::scheduler()->erase(&m_task_shutdown);
|
||||
|
||||
if(!display::Canvas::daemon())
|
||||
m_inputStdin->remove(torrent::this_thread::poll());
|
||||
m_inputStdin->remove();
|
||||
|
||||
if (scgi_thread::thread()->is_active())
|
||||
scgi_thread::thread()->stop_thread_wait();
|
||||
|
||||
Reference in New Issue
Block a user