Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleanup.

  • Loading branch information...
commit f031b3c6286adb5edb5c48f9bbb41eb23007ee02 1 parent bc458d9
@nicolasff nicolasff authored
Showing with 6 additions and 6 deletions.
  1. +0 −2  common.h
  2. +6 −4 redis.c
View
2  common.h
@@ -60,7 +60,6 @@
redis_sock->pipeline_current = tmp; \
if(NULL == redis_sock->pipeline_head) { \
redis_sock->pipeline_head = redis_sock->pipeline_current;\
- /* head_request = current_request;*/ \
}
#define SOCKET_WRITE_COMMAND(redis_sock, cmd, cmd_len) if(redis_sock_write(redis_sock, cmd, cmd_len) < 0) { \
@@ -76,7 +75,6 @@
if(current) current->next = f1; \
redis_sock->current = f1; \
if(NULL == redis_sock->head) { \
- /* head = current;*/ \
redis_sock->head = redis_sock->current;\
}\
}
View
10 redis.c
@@ -784,7 +784,7 @@ PHP_METHOD(Redis, getMultiple)
HashPosition pointer;
RedisSock *redis_sock;
char *cmd = "", *old_cmd = NULL;
- int cmd_len, array_count;
+ int cmd_len = 0, array_count, elements = 1;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa",
&object, redis_ce, &array) == FAILURE) {
@@ -812,16 +812,18 @@ PHP_METHOD(Redis, getMultiple)
if(*cmd) {
old_cmd = cmd;
}
- cmd_len = spprintf(&cmd, 0, "%s %s", cmd, Z_STRVAL_PP(data));
+ cmd_len = redis_cmd_format(&cmd, "%s$%d" _NL "%s" _NL
+ , cmd, cmd_len
+ , Z_STRLEN_PP(data), Z_STRVAL_PP(data), Z_STRLEN_PP(data));
if(old_cmd) {
efree(old_cmd);
}
+ elements++;
}
}
old_cmd = cmd;
- cmd_len = spprintf(&cmd, 0, "MGET %s\r\n", cmd);
-
+ cmd_len = redis_cmd_format(&cmd, "*%d" _NL "$4" _NL "MGET" _NL "%s", elements, cmd, cmd_len);
efree(old_cmd);
REDIS_PROCESS_REQUEST(redis_sock, cmd, cmd_len);
Please sign in to comment.
Something went wrong with that request. Please try again.