Lines Matching refs:env
139 redis_init(struct module_env* env, struct cachedb_env* cachedb_env) in redis_init() argument
151 moddata->numctxs = env->cfg->num_threads; in redis_init()
152 moddata->ctxs = calloc(env->cfg->num_threads, sizeof(redisContext*)); in redis_init()
159 moddata->server_host = env->cfg->redis_server_host; in redis_init()
160 moddata->server_port = env->cfg->redis_server_port; in redis_init()
161 moddata->server_path = env->cfg->redis_server_path; in redis_init()
162 moddata->server_password = env->cfg->redis_server_password; in redis_init()
163 moddata->command_timeout.tv_sec = env->cfg->redis_timeout / 1000; in redis_init()
165 (env->cfg->redis_timeout % 1000) * 1000; in redis_init()
166 moddata->connect_timeout.tv_sec = env->cfg->redis_timeout / 1000; in redis_init()
168 (env->cfg->redis_timeout % 1000) * 1000; in redis_init()
169 if(env->cfg->redis_command_timeout != 0) { in redis_init()
171 env->cfg->redis_command_timeout / 1000; in redis_init()
173 (env->cfg->redis_command_timeout % 1000) * 1000; in redis_init()
175 if(env->cfg->redis_connect_timeout != 0) { in redis_init()
177 env->cfg->redis_connect_timeout / 1000; in redis_init()
179 (env->cfg->redis_connect_timeout % 1000) * 1000; in redis_init()
181 moddata->logical_db = env->cfg->redis_logical_db; in redis_init()
191 if(env->cfg->redis_expire_records) { in redis_init()
195 rep = redis_command(env, cachedb_env, in redis_init()
225 redis_deinit(struct module_env* env, struct cachedb_env* cachedb_env) in redis_deinit() argument
229 (void)env; in redis_deinit()
248 redis_command(struct module_env* env, struct cachedb_env* cachedb_env, in redis_command() argument
261 log_assert(env->alloc->thread_num < d->numctxs); in redis_command()
262 ctx = d->ctxs[env->alloc->thread_num]; in redis_command()
269 d->ctxs[env->alloc->thread_num] = ctx; in redis_command()
282 d->ctxs[env->alloc->thread_num] = NULL; in redis_command()
296 redis_lookup(struct module_env* env, struct cachedb_env* cachedb_env, in redis_lookup() argument
312 rep = redis_command(env, cachedb_env, cmdbuf, NULL, 0); in redis_lookup()
344 redis_store(struct module_env* env, struct cachedb_env* cachedb_env, in redis_store() argument
349 int set_ttl = (env->cfg->redis_expire_records && in redis_store()
350 (!env->cfg->serve_expired || env->cfg->serve_expired_ttl > 0)); in redis_store()
363 ttl += env->cfg->serve_expired_ttl; in redis_store()
377 rep = redis_command(env, cachedb_env, cmdbuf, data, data_len); in redis_store()