diff options
author | Alessio M <masariello@gmail.com> | 2020-09-04 09:31:47 +0100 |
---|---|---|
committer | Alessio M <masariello@gmail.com> | 2020-09-04 09:31:47 +0100 |
commit | d7b1d21e807f8a90a086b2ef5cea9b707d4cc858 (patch) | |
tree | 748b00a48a8b625f1dca22ae4cc5721ab7de87c5 /async.c | |
parent | 07c3618ffe7912c2ebc589ea45501c687a19cf2c (diff) | |
parent | fb0e6c0dd9affd5728c6e0a6423f5dcb7b207947 (diff) |
Merge branch 'master' of github.com:redis/hiredis
Diffstat (limited to 'async.c')
-rw-r--r-- | async.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -47,6 +47,11 @@ #include "async_private.h" +#ifdef NDEBUG +#undef assert +#define assert(e) (void)(e) +#endif + /* Forward declarations of hiredis.c functions */ int __redisAppendCommand(redisContext *c, const char *cmd, size_t len); void __redisSetError(redisContext *c, int type, const char *str); @@ -868,19 +873,19 @@ redisAsyncPushFn *redisAsyncSetPushCallback(redisAsyncContext *ac, redisAsyncPus } int redisAsyncSetTimeout(redisAsyncContext *ac, struct timeval tv) { - if (!ac->c.timeout) { - ac->c.timeout = hi_calloc(1, sizeof(tv)); - if (ac->c.timeout == NULL) { + if (!ac->c.command_timeout) { + ac->c.command_timeout = hi_calloc(1, sizeof(tv)); + if (ac->c.command_timeout == NULL) { __redisSetError(&ac->c, REDIS_ERR_OOM, "Out of memory"); __redisAsyncCopyError(ac); return REDIS_ERR; } } - if (tv.tv_sec != ac->c.timeout->tv_sec || - tv.tv_usec != ac->c.timeout->tv_usec) + if (tv.tv_sec != ac->c.command_timeout->tv_sec || + tv.tv_usec != ac->c.command_timeout->tv_usec) { - *ac->c.timeout = tv; + *ac->c.command_timeout = tv; } return REDIS_OK; |