summaryrefslogtreecommitdiff
path: root/adapters/libuv.h
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/libuv.h')
-rw-r--r--adapters/libuv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/adapters/libuv.h b/adapters/libuv.h
index df0a845..268edab 100644
--- a/adapters/libuv.h
+++ b/adapters/libuv.h
@@ -30,6 +30,10 @@ static void redisLibuvPoll(uv_poll_t* handle, int status, int events) {
static void redisLibuvAddRead(void *privdata) {
redisLibuvEvents* p = (redisLibuvEvents*)privdata;
+ if (p->events & UV_READABLE) {
+ return;
+ }
+
p->events |= UV_READABLE;
uv_poll_start(&p->handle, p->events, redisLibuvPoll);
@@ -52,6 +56,10 @@ static void redisLibuvDelRead(void *privdata) {
static void redisLibuvAddWrite(void *privdata) {
redisLibuvEvents* p = (redisLibuvEvents*)privdata;
+ if (p->events & UV_WRITABLE) {
+ return;
+ }
+
p->events |= UV_WRITABLE;
uv_poll_start(&p->handle, p->events, redisLibuvPoll);