mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-02 11:57:43 +08:00
fix bug when result is a empty string from redis-server
This commit is contained in:
parent
6795c9dfd7
commit
91dd70f286
@ -1,6 +1,10 @@
|
||||
修改历史列表:
|
||||
|
||||
------------------------------------------------------------------------
|
||||
302) 2015.4.21
|
||||
302.1) buffix: redis_client::get_redis_string 当数据长度为 0 时会出现异常,
|
||||
从而兼容 redis 是允许数据值为空串的情况
|
||||
|
||||
301) 2015.4.19
|
||||
301.1) feature: 完善了 redis_cluster 集群管理类
|
||||
|
||||
|
@ -146,7 +146,7 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
|
||||
{
|
||||
rr->set_size(1);
|
||||
buf = (char*) pool->dbuf_alloc(len + 1);
|
||||
if (conn_.read(buf, (size_t) len) == -1)
|
||||
if (len > 0 && conn_.read(buf, (size_t) len) == -1)
|
||||
return NULL;
|
||||
buf[len] = 0;
|
||||
rr->put(buf, (size_t) len);
|
||||
|
Loading…
Reference in New Issue
Block a user