From 171777c4151ea6ed0a8193055ca6e2690e73d142 Mon Sep 17 00:00:00 2001 From: zhengshuxin Date: Tue, 7 Jun 2022 20:13:13 +0800 Subject: [PATCH] fixed one important bugs in redis pipeline mode. --- lib_acl_cpp/include/acl_cpp/redis/redis_client_pipeline.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib_acl_cpp/include/acl_cpp/redis/redis_client_pipeline.hpp b/lib_acl_cpp/include/acl_cpp/redis/redis_client_pipeline.hpp index ad6aa03f4..1910aabd1 100644 --- a/lib_acl_cpp/include/acl_cpp/redis/redis_client_pipeline.hpp +++ b/lib_acl_cpp/include/acl_cpp/redis/redis_client_pipeline.hpp @@ -90,12 +90,15 @@ class redis_pipeline_message { } void set_request(size_t argc, const char** argv, size_t* lens) { + // When running in coroutine of shared stack mode, + // the variables on stack are volatile, so we should save + // the request data in heap. #if 0 argc_ = argc; argv_ = argv; lens_ = lens; #else - if (argc_ > size_) { + if (argc > size_) { delete [] argv_; delete [] lens_; size_ = argc;