diff options
Diffstat (limited to 'modules/m_redis.cpp')
-rw-r--r-- | modules/m_redis.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/m_redis.cpp b/modules/m_redis.cpp index d8398c1b5..23865e815 100644 --- a/modules/m_redis.cpp +++ b/modules/m_redis.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2003-2016 Anope Team + * (C) 2003-2017 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. @@ -157,6 +157,11 @@ class MyRedisService : public Provider } public: + bool IsSocketDead() anope_override + { + return this->sock && this->sock->flags[SF_DEAD]; + } + void SendCommand(RedisSocket *s, Interface *i, const std::vector<Anope::string> &cmds) { std::vector<std::pair<const char *, size_t> > args; @@ -201,9 +206,11 @@ class MyRedisService : public Provider public: bool BlockAndProcess() anope_override { - this->sock->ProcessWrite(); + if (!this->sock->ProcessWrite()) + this->sock->flags[SF_DEAD] = true; this->sock->SetBlocking(true); - this->sock->ProcessRead(); + if (!this->sock->ProcessRead()) + this->sock->flags[SF_DEAD] = true; this->sock->SetBlocking(false); return !this->sock->interfaces.empty(); } |