@@ -2491,21 +2491,18 @@ redis_read_vinfo_response(RedisSock *redis_sock, zval *z_ret, long long count) {
24912491size_t klen ,vlen ;
24922492long lval ;
24932493
2494- if (count < 0 || count %2 != 0 ) {
2494+ if (count < 0 || count %2 != 0 || Z_TYPE_P ( z_ret ) != IS_ARRAY ) {
24952495zend_error_noreturn (E_ERROR ,"Internal finfo handler error" );
24962496 }
24972497
24982498for (long long i = 0 ;i < count ;i += 2 ) {
24992499if (redis_read_reply_type (redis_sock ,& type ,& lval )< 0 ||
2500- type != TYPE_LINE )
2500+ type != TYPE_LINE ||
2501+ redis_sock_gets (redis_sock ,kbuf ,sizeof (kbuf ),& klen )< 0 )
25012502 {
25022503return FAILURE ;
25032504 }
25042505
2505- if (redis_sock_gets (redis_sock ,kbuf ,sizeof (kbuf ),& klen )< 0 ) {
2506- return FAILURE ;
2507- }
2508-
25092506if (redis_read_reply_type (redis_sock ,& type ,& lval )< 0 ) {
25102507return FAILURE ;
25112508 }
@@ -2521,10 +2518,8 @@ redis_read_vinfo_response(RedisSock *redis_sock, zval *z_ret, long long count) {
25212518add_assoc_long_ex (z_ret ,kbuf ,klen ,lval );
25222519break ;
25232520default :
2524- add_assoc_null_ex (z_ret ,kbuf ,klen );
2525- break ;
2526-
2527- }
2521+ return FAILURE ;
2522+ }
25282523 }
25292524
25302525return SUCCESS ;
@@ -2558,8 +2553,77 @@ redis_vinfo_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
25582553return SUCCESS ;
25592554}
25602555
2556+ /* Unfortunately VEMB decided to use +string\r\n for the encoding when RAW is
2557+ * sent which PhpRedis will parse as `(true)` so we need a specific handler for
2558+ * it */
25612559PHP_REDIS_API int
2562- redis_xinfo_reply (INTERNAL_FUNCTION_PARAMETERS ,RedisSock * redis_sock ,zval * z_tab ,void * ctx )
2560+ redis_read_vemb_response (RedisSock * redis_sock ,zval * z_ret ,long long count ) {
2561+ REDIS_REPLY_TYPE type ;
2562+ char kbuf [256 ],* str ;
2563+ size_t klen ;
2564+ double dval ;
2565+ long tlen ;
2566+
2567+ if (count < 0 || Z_TYPE_P (z_ret )!= IS_ARRAY ) {
2568+ zend_error_noreturn (E_ERROR ,"Internal vemb handler error" );
2569+ }
2570+
2571+ for (long long i = 0 ;i < count ;i ++ ) {
2572+ if (redis_read_reply_type (redis_sock ,& type ,& tlen )< 0 ) {
2573+ return FAILURE ;
2574+ }
2575+
2576+ if (type == TYPE_LINE ) {
2577+ if (redis_sock_gets (redis_sock ,kbuf ,sizeof (kbuf ),& klen )< 0 )
2578+ return FAILURE ;
2579+ add_next_index_stringl (z_ret ,kbuf ,klen );
2580+ }else if (type == TYPE_BULK ) {
2581+ if ((str = redis_sock_read_bulk_reply (redis_sock ,tlen ))== NULL )
2582+ return FAILURE ;
2583+
2584+ if (is_numeric_string (str ,tlen ,NULL ,& dval ,0 )== IS_DOUBLE ) {
2585+ add_next_index_double (z_ret ,dval );
2586+ }else {
2587+ add_next_index_stringl (z_ret ,str ,tlen );
2588+ }
2589+
2590+ efree (str );
2591+ }else {
2592+ return FAILURE ;
2593+ }
2594+ }
2595+
2596+ return SUCCESS ;
2597+ }
2598+
2599+ PHP_REDIS_API int
2600+ redis_vemb_reply (INTERNAL_FUNCTION_PARAMETERS ,RedisSock * redis_sock ,
2601+ zval * z_tab ,void * ctx )
2602+ {
2603+ zval z_ret ;
2604+ int count ;
2605+
2606+ if (read_mbulk_header (redis_sock ,& count )< 0 || count < 1 ) {
2607+ REDIS_RESPONSE_ERROR (redis_sock ,z_tab );
2608+ return FAILURE ;
2609+ }
2610+
2611+ array_init_size (& z_ret ,count );
2612+
2613+ if (redis_read_vemb_response (redis_sock ,& z_ret ,count )!= SUCCESS ) {
2614+ zval_dtor (& z_ret );
2615+ REDIS_RESPONSE_ERROR (redis_sock ,z_tab );
2616+ return FAILURE ;
2617+ }
2618+
2619+ REDIS_RETURN_ZVAL (redis_sock ,z_tab ,z_ret );
2620+
2621+ return SUCCESS ;
2622+ }
2623+
2624+ PHP_REDIS_API int
2625+ redis_xinfo_reply (INTERNAL_FUNCTION_PARAMETERS ,RedisSock * redis_sock ,
2626+ zval * z_tab ,void * ctx )
25632627{
25642628zval z_ret ;
25652629int elements ;