event/SocketMonitor: don't filter out ERROR/HANGUP
By bit-wise ANDing the reported flags with GetScheduledFlags(), ERROR/HANGUP always get cleared. This means the MPD event loop could never report those conditions.
This commit is contained in:
parent
eeb96eb367
commit
41c0bbab13
@ -30,7 +30,7 @@
|
||||
void
|
||||
SocketMonitor::Dispatch(unsigned flags) noexcept
|
||||
{
|
||||
flags &= GetScheduledFlags();
|
||||
flags &= GetScheduledFlags() | IMPLICIT_FLAGS;
|
||||
|
||||
if (flags != 0)
|
||||
OnSocketReady(flags);
|
||||
|
@ -57,6 +57,12 @@ public:
|
||||
static constexpr unsigned ERROR = PollGroup::ERROR;
|
||||
static constexpr unsigned HANGUP = PollGroup::HANGUP;
|
||||
|
||||
/**
|
||||
* These flags are always reported by epoll_wait() and don't
|
||||
* need to be registered with epoll_ctl().
|
||||
*/
|
||||
static constexpr unsigned IMPLICIT_FLAGS = ERROR|HANGUP;
|
||||
|
||||
typedef std::make_signed<size_t>::type ssize_t;
|
||||
|
||||
explicit SocketMonitor(EventLoop &_loop) noexcept
|
||||
|
Loading…
Reference in New Issue
Block a user