From af7369a253247e23f699a0d803f68b3ade022044 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 1 Dec 2010 16:43:21 +0100 Subject: 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. --- adapters/ae.h | 4 ++-- adapters/libev.h | 4 ++-- adapters/libevent.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'adapters') 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); -- cgit v1.2.3