/* eval needs special formatting to work properly */
redisAppendCommand(context->context, "eval %s %d %s", cur_request->request, cur_request->num_keys, cur_request->keys ? cur_request->keys : "");
} else {
- redisAppendCommand(context->context, cur_request->request);
+ if (cur_request->argc == 0) {
+ cur_request->argc = switch_separate_string(cur_request->request, ' ', cur_request->argv, MOD_HIREDIS_MAX_ARGS);
+ }
+ if (cur_request->argc > 0) {
+ redisAppendCommandArgv(context->context, cur_request->argc, (const char **)cur_request->argv, NULL);
+ }
}
}
#include <switch.h>
#include <hiredis/hiredis.h>
+#define MOD_HIREDIS_MAX_ARGS 64
+
typedef struct mod_hiredis_global_s {
switch_memory_pool_t *pool;
switch_hash_t *profiles;
switch_mutex_t *mutex;
switch_thread_cond_t *cond;
struct hiredis_request_s *next;
+ size_t argc;
+ char *argv[MOD_HIREDIS_MAX_ARGS];
} hiredis_request_t;
typedef struct mod_hiredis_context_s {