diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-12-01 16:43:21 +0100 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-12-01 16:43:24 +0100 |
commit | af7369a253247e23f699a0d803f68b3ade022044 (patch) | |
tree | af3aae5b9667cd9b1008f3cd2d6c4389c561aa5e /adapters | |
parent | 9af1574d6e65bac7b39e7036056cb326064f1ac4 (diff) |
Use extra field for adapter-specific data
This makes sure that the "data" field on the asynchronous context can be
used for user-specific data.
Diffstat (limited to 'adapters')
-rw-r--r-- | adapters/ae.h | 4 | ||||
-rw-r--r-- | adapters/libev.h | 4 | ||||
-rw-r--r-- | adapters/libevent.h | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/adapters/ae.h b/adapters/ae.h index 8d0b526..b8b2228 100644 --- a/adapters/ae.h +++ b/adapters/ae.h @@ -72,7 +72,7 @@ int redisAeAttach(aeEventLoop *loop, redisAsyncContext *ac) { redisAeEvents *e; /* Nothing should be attached when something is already attached */ - if (ac->data != NULL) + if (ac->_adapter_data != NULL) return REDIS_ERR; /* Create container for context and r/w events */ @@ -88,7 +88,7 @@ int redisAeAttach(aeEventLoop *loop, redisAsyncContext *ac) { ac->evAddWrite = redisAeAddWrite; ac->evDelWrite = redisAeDelWrite; ac->evCleanup = redisAeCleanup; - ac->data = e; + ac->_adapter_data = e; return REDIS_OK; } diff --git a/adapters/libev.h b/adapters/libev.h index 8a2a4f3..3b9ed65 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->data != NULL) + if (ac->_adapter_data != NULL) return REDIS_ERR; /* Create container for context and r/w events */ @@ -103,7 +103,7 @@ int redisLibevAttach(EV_P_ redisAsyncContext *ac) { ac->evAddWrite = redisLibevAddWrite; ac->evDelWrite = redisLibevDelWrite; ac->evCleanup = redisLibevCleanup; - ac->data = e; + ac->_adapter_data = e; /* Initialize read/write events */ ev_io_init(&e->rev,redisLibevReadEvent,c->fd,EV_READ); diff --git a/adapters/libevent.h b/adapters/libevent.h index 8531c52..dc1f5c7 100644 --- a/adapters/libevent.h +++ b/adapters/libevent.h @@ -52,7 +52,7 @@ int redisLibeventAttach(redisAsyncContext *ac, struct event_base *base) { redisLibeventEvents *e; /* Nothing should be attached when something is already attached */ - if (ac->data != NULL) + if (ac->_adapter_data != NULL) return REDIS_ERR; /* Create container for context and r/w events */ @@ -65,7 +65,7 @@ int redisLibeventAttach(redisAsyncContext *ac, struct event_base *base) { ac->evAddWrite = redisLibeventAddWrite; ac->evDelWrite = redisLibeventDelWrite; ac->evCleanup = redisLibeventCleanup; - ac->data = e; + ac->_adapter_data = e; /* Initialize and install read/write events */ event_set(&e->rev,c->fd,EV_READ,redisLibeventReadEvent,e); |