Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c4b2ea6

Browse filesBrowse files
Fix VEMB reply handling in RedisCluster
1 parent 0b4b4ed commit c4b2ea6
Copy full SHA for c4b2ea6

3 files changed

+30-2Lines changed: 30 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎cluster_library.c‎

Copy file name to clipboardExpand all lines: cluster_library.c
+27-1Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2506,6 +2506,33 @@ cluster_xclaim_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx) {
25062506

25072507
}
25082508

2509+
PHP_REDIS_API void
2510+
cluster_vemb_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx) {
2511+
zval z_ret;
2512+
2513+
ZVAL_FALSE(&z_ret);
2514+
2515+
if (c->reply_type != TYPE_MULTIBULK || c->reply_len < 0)
2516+
goto fail;
2517+
2518+
array_init(&z_ret);
2519+
2520+
if (redis_read_vemb_response(c->cmd_sock, &z_ret, c->reply_len) != SUCCESS)
2521+
goto fail;
2522+
2523+
if (CLUSTER_IS_ATOMIC(c)) {
2524+
RETURN_ZVAL(&z_ret, 0, 1);
2525+
} else {
2526+
add_next_index_zval(&c->multi_resp, &z_ret);
2527+
}
2528+
2529+
return;
2530+
2531+
fail:
2532+
zval_dtor(&z_ret);
2533+
CLUSTER_RETURN_FALSE(c);
2534+
}
2535+
25092536
PHP_REDIS_API void
25102537
cluster_vinfo_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx) {
25112538
zval z_ret;
@@ -2554,7 +2581,6 @@ cluster_vgetattr_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx)
25542581
}
25552582
}
25562583

2557-
25582584
PHP_REDIS_API void
25592585
cluster_vlinks_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, void *ctx) {
25602586
zval z_ret;
Collapse file

‎cluster_library.h‎

Copy file name to clipboardExpand all lines: cluster_library.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ PHP_REDIS_API void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *
448448
void *ctx);
449449
PHP_REDIS_API void cluster_unsub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
450450
void *ctx);
451+
PHP_REDIS_API void cluster_vemb_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
452+
void *ctx);
451453
PHP_REDIS_API void cluster_vinfo_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
452454
void *ctx);
453455
PHP_REDIS_API void cluster_vlinks_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
Collapse file

‎redis_cluster.c‎

Copy file name to clipboardExpand all lines: redis_cluster.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3201,7 +3201,7 @@ PHP_METHOD(RedisCluster, vinfo) {
32013201
}
32023202

32033203
PHP_METHOD(RedisCluster, vemb) {
3204-
CLUSTER_PROCESS_CMD(vemb, cluster_variant_resp, 1);
3204+
CLUSTER_PROCESS_CMD(vemb, cluster_vemb_resp, 1);
32053205
}
32063206

32073207
PHP_METHOD(RedisCluster, vrandmember) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.