diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-12-29 15:41:03 +0100 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-12-29 15:41:03 +0100 |
commit | 18c55a8f1e93aaa4df6c970333ad3d691e3438b0 (patch) | |
tree | a6482fb7cfd2494394865325d84d91de01a163da /adapters/libev.h | |
parent | 8cb4d52cd273d6134f881c232a307c3259af334a (diff) |
Scope event library related data and hooks to a struct
Diffstat (limited to 'adapters/libev.h')
-rw-r--r-- | adapters/libev.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/adapters/libev.h b/adapters/libev.h index 3b9ed65..7b2b6af 100644 --- a/adapters/libev.h +++ b/adapters/libev.h @@ -82,7 +82,7 @@ int redisLibevAttach(EV_P_ redisAsyncContext *ac) { redisLibevEvents *e; /* Nothing should be attached when something is already attached */ - if (ac->_adapter_data != NULL) + if (ac->ev.data != NULL) return REDIS_ERR; /* Create container for context and r/w events */ @@ -98,12 +98,12 @@ int redisLibevAttach(EV_P_ redisAsyncContext *ac) { e->wev.data = e; /* Register functions to start/stop listening for events */ - ac->evAddRead = redisLibevAddRead; - ac->evDelRead = redisLibevDelRead; - ac->evAddWrite = redisLibevAddWrite; - ac->evDelWrite = redisLibevDelWrite; - ac->evCleanup = redisLibevCleanup; - ac->_adapter_data = e; + ac->ev.addRead = redisLibevAddRead; + ac->ev.delRead = redisLibevDelRead; + ac->ev.addWrite = redisLibevAddWrite; + ac->ev.delWrite = redisLibevDelWrite; + ac->ev.cleanup = redisLibevCleanup; + ac->ev.data = e; /* Initialize read/write events */ ev_io_init(&e->rev,redisLibevReadEvent,c->fd,EV_READ); |