8000 Fix compile errors in redis_session.c · jrtkcoder/phpredis@9cb9d07 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9cb9d07

Browse files
committed
Fix compile errors in redis_session.c
1 parent 9d51c89 commit 9cb9d07

File tree

7 files changed

+78
-103
lines changed

7 files changed

+78
-103
lines changed

cluster_library.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -581,32 +581,6 @@ unsigned short cluster_hash_key_zval(zval *z_key) {
581581
return cluster_hash_key(kptr, klen);
582582
}
583583

584-
static char **split_str_by_delim(char *str, char *delim, int *len) {
585-
char **array, *tok, *tok_buf;
586-
int size=16;
587-
588-
*len = 0;
589-
590-
// Initial storage
591-
array = emalloc(size * sizeof(char*));
592-
593-
tok = php_strtok_r(str, delim, &tok_buf);
594-
595-
while(tok) {
596-
if(size == *len) {
597-
size *= 2;
598-
array = erealloc(array, size * sizeof(char*));
599-
}
600-
601-
array[*len] = tok;
602-
(*len)++;
603-
604-
tok = php_strtok_r(NULL, delim, &tok_buf);
605-
}
606-
607-
return array;
608-
}
609-
610584
/* Execute a CLUSTER SLOTS command against the seed socket, and return the
611585
* reply or NULL on failure. */
612586
clusterReply* cluster_get_slots(RedisSock *redis_sock TSRMLS_DC)

cluster_library.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,4 +460,4 @@ int mbulk_resp_loop_assoc(RedisSock *redis_sock, zval *z_result,
460460

461461
#endif
462462

463-
/* vim: set tabstop=4 softtabstops=4 noexpandtab shiftwidth=4: */
463+
/* vim: set tabstop=4 softtabstop=4 noexpandtab shiftwidth=4: */

redis.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "redis_cluster.h"
3434
#include <zend_exceptions.h>
3535

36-
#ifdef PHP_SESSION_NEW
36+
#ifdef PHP_SESSION
3737
#include "ext/session/php_session.h"
3838
#endif
3939

@@ -50,7 +50,7 @@
5050
int le_redis_sock;
5151
extern int le_redis_array;
5252

53-
#ifdef PHP_SESSION_NEW
53+
#ifdef PHP_SESSION
5454
extern ps_module ps_mod_redis;
5555
extern ps_module ps_mod_redis_cluster;
5656
#endif

redis_array.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,7 @@ PHP_METHOD(RedisArray, del)
10921092
HANDLE_MULTI_EXEC("DEL");
10931093

10941094
/* get all args in z_args */
1095+
z_args = (zval *) safe_emalloc(sizeof(zval), ZEND_NUM_ARGS(), 0);
10951096
if(zend_get_parameters_array(ht, ZEND_NUM_ARGS(), z_args) == FAILURE) {
10961097
efree(z_args);
10971098
RETURN_FALSE;

redis_cluster.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,6 +2873,7 @@ PHP_METHOD(RedisCluster, rawcommand) {
28732873
short slot;
28742874

28752875
/* Sanity check on our arguments */
2876+
z_args = (zval *) safe_emalloc(sizeof(zval), argc, 0);
28762877
if (argc < 2) {
28772878
php_error_docref(NULL TSRMLS_CC, E_WARNING,
28782879
"You must pass at least node information as well as at least a command.");

redis_commands.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,7 @@ int redis_bitop_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
16971697
smart_string cmdstr = {0};
16981698
short kslot;
16991699

1700+
z_args = (zval *) safe_emalloc(sizeof(zval), argc, 0);
17001701
if(zend_get_parameters_array(ht, argc, z_args) == FAILURE ||
17011702
argc < 3 || Z_TYPE(z_args[0]) != IS_STRING)
17021703
{

0 commit comments

Comments
 (0)
0