8000 Remove unused redis_debug_response method from library.c · phpredis/phpredis@7895636 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7895636

Browse files
JakubOnderkamichael-grunder
authored andcommitted
Remove unused redis_debug_response method from library.c
1 parent 2434ba2 commit 7895636

File tree

1 file changed

+0
-61
lines changed

1 file changed

+0
-61
lines changed

library.c

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2718,67 +2718,6 @@ redis_ping_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
27182718
return SUCCESS;
27192719
}
27202720

2721-
/* Response for DEBUG object which is a formatted single line reply */
2722-
PHP_REDIS_API void redis_debug_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
2723-
zval *z_tab, void *ctx)
2724-
{
2725-
char *resp, *p, *p2, *p3, *p4;
2726-
int is_numeric, resp_len;
2727-
2728-
/* Add or return false if we can't read from the socket */
2729-
if((resp = redis_sock_read(redis_sock, &resp_len))==NULL) {
2730-
if (IS_ATOMIC(redis_sock)) {
2731-
RETURN_FALSE;
2732-
}
2733-
add_next_index_bool(z_tab, 0);
2734-
return;
2735-
}
2736-
2737-
zval z_result;
2738-
array_init(&z_result);
2739-
2740-
/* Skip the '+' */
2741-
p = resp + 1;
2742-
2743-
/* <info>:<value> <info2:value2> ... */
2744-
while((p2 = strchr(p, ':'))!=NULL) {
2745-
/* Null terminate at the ':' */
2746-
*p2++ = '\0';
2747-
2748-
/* Null terminate at the space if we have one */
2749-
if((p3 = strchr(p2, ' '))!=NULL) {
2750-
*p3++ = '\0';
2751-
} else {
2752-
p3 = resp + resp_len;
2753-
}
2754-
2755-
is_numeric = 1;
2756-
for(p4=p2; *p4; ++p4) {
2757-
if(*p4 < '0' || *p4 > '9') {
2758-
is_numeric = 0;
2759-
break;
2760-
}
2761-
}
2762-
2763-
/* Add our value */
2764-
if(is_numeric) {
2765-
add_assoc_long(&z_result, p, atol(p2));
2766-
} else {
2767-
add_assoc_string(&z_result, p, p2);
2768-
}
2769-
2770-
p = p3;
2771-
}
2772-
2773-
efree(resp);
2774-
2775-
if (IS_ATOMIC(redis_sock)) {
2776-
RETVAL_ZVAL(&z_result, 0, 1);
2777-
} else {
2778-
add_next_index_zval(z_tab, &z_result);
2779-
}
2780-
}
2781-
27822721
PHP_REDIS_API int
27832722
redis_sock_configure(RedisSock *redis_sock, HashTable *opts)
27842723
{

0 commit comments

Comments
 (0)
0