summaryrefslogtreecommitdiff
path: root/modules/m_redis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/m_redis.cpp')
-rw-r--r--modules/m_redis.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/m_redis.cpp b/modules/m_redis.cpp
index 7945ab9cc..23865e815 100644
--- a/modules/m_redis.cpp
+++ b/modules/m_redis.cpp
@@ -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();
}