mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-05 17:52:29 +00:00
Clean up comments in InputEvent methods
Removed commented-out code regarding error handling for stdin and event processing.
This commit is contained in:
@@ -13,18 +13,11 @@ void
|
|||||||
InputEvent::insert() {
|
InputEvent::insert() {
|
||||||
torrent::this_thread::poll()->open(this);
|
torrent::this_thread::poll()->open(this);
|
||||||
torrent::this_thread::poll()->insert_read(this);
|
torrent::this_thread::poll()->insert_read(this);
|
||||||
// EPOLLERR/EPOLLHUP is always delivered by epoll regardless of registration;
|
|
||||||
// register for it so a controlling-terminal/pty hangup on stdin is dispatched
|
|
||||||
// to event_error() instead of aborting the whole client (see event_error()).
|
|
||||||
torrent::this_thread::poll()->insert_error(this);
|
torrent::this_thread::poll()->insert_error(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InputEvent::remove() {
|
InputEvent::remove() {
|
||||||
// The file descriptor doubles as the open-state guard, mirroring SCgiTask.
|
|
||||||
// event_error() may already have dropped stdin from the poll set and cleared
|
|
||||||
// the fd; the shutdown path (Control::cleanup) still calls remove(), and a
|
|
||||||
// second remove_and_close() would throw "event not found" via event_mask().
|
|
||||||
if (!is_open())
|
if (!is_open())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -46,12 +39,6 @@ InputEvent::event_write() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
InputEvent::event_error() {
|
InputEvent::event_error() {
|
||||||
// The controlling terminal/pty hung up (EPOLLERR on stdin). Drop stdin from
|
|
||||||
// the poll set instead of letting Poll::process() throw an internal_error and
|
|
||||||
// kill the client -- a regression introduced with the 0.16.13 callback/poll
|
|
||||||
// rework. rtorrent keeps running with no keyboard input. Once removed the
|
|
||||||
// event is out of the poll table, so no further event_error() is dispatched
|
|
||||||
// to it; clearing the fd lets the shutdown remove() no-op.
|
|
||||||
torrent::this_thread::poll()->remove_and_close(this);
|
torrent::this_thread::poll()->remove_and_close(this);
|
||||||
set_file_descriptor(-1);
|
set_file_descriptor(-1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user