Skip to content

Commit ab5ec2e

Browse files
author
ubuntu14
committed
acl 3.1.2 version released
1 parent dd45047 commit ab5ec2e

File tree

7 files changed

+37
-11
lines changed

7 files changed

+37
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ endif
4242
##############################################################################
4343

4444
.PHONY = check help all clean install uninstall uninstall_all build_bin build_src
45-
VERSION = 3.1.0
45+
VERSION = 3.1.2
4646

4747
help:
4848
@(echo "usage: make help|all|clean|install|uninstall|uninstall_all|build_bin|build_src")

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ acl
148148
- 13 queue: 磁盘文件队列操作库
149149
- 14 ipc: 阻塞/非阻塞通信整合库
150150
- 15 session: HTTP 会话库
151-
- 16 redis: 完整实现了 redis 协议的客户端通信库(总共 12 个大类,150 多个命令),支持连接池及连接池集群管理
151+
- **16 redis: 完整实现了 redis 协议的客户端通信库(总共 12 个大类,150 多个命令),支持连接池及连接池集群管理**
152+
- 17 disque: 支持集群消息队列服务 disque 的客户端库,支持连接池及连接池集群管理
152153

153154
### 3.4、图例
154155
* 类索引图:

changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
�޸���ʷ�б���
22
------------------------------------------------------------------------
3+
86) 2015.5.9 --- acl 3.1.2 �汾������
34
85) 2015.5.5
45
85.1) lib_acl_cpp/samples/disque: ���Էֲ�ʽ��Ϣ���� disque �ͻ��˿�����
56

lib_acl/src/init/acl_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include "init.h"
2626

27-
static char *version = "acl_3.1.1";
27+
static char *version = "acl_3.1.2";
2828

2929
const char *acl_version(void)
3030
{

lib_acl_cpp/samples/disque/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ int main(void)
141141
```
142142

143143
### add acl disque to your projects
144-
Before you use the acl disque, you should compile the three base libraries which disque depending on. Enter the ** lib_acl, lib_protocol, lib_acl_cpp,** and build the lib_acl.a, lib_protocol.a and lib_acl_cpp.a.
144+
Before you use the acl disque, you should compile the three base libraries which disque depending on. Enter the `lib_acl`, `lib_protocol`, `lib_acl_cpp`, and build the `lib_acl.a`, `lib_protocol.a` and `lib_acl_cpp.a`.
145145
```compile
146146
$cd lib_acl; make
147147
$cd lib_protocol; make
@@ -152,7 +152,7 @@ $cd lib_acl_cpp; make
152152
In your Makefile, you should add below compiling flags:
153153
-DLINUX2 for LINUX, -DFREEBSD for FreeBSD, -DMACOSX for MAXOS, -DSUNOS5 for Solaris X86;
154154
-I path specify the lib_acl.hpp's parent path, for exmaple: -I./lib_acl_cpp/include, in the lib_acl_cpp/include path the acl_cpp path should be included;
155-
At last, link with ** -L{path_to_acl_cpp} -l_acl_cpp -L{path_to_protocol} -l_protocol -L{path_to_acl) -l_acl **
155+
At last, link with `-L{path_to_acl_cpp} -l_acl_cpp -L{path_to_protocol} -l_protocol -L{path_to_acl) -l_acl`
156156
Of couse you can look at the Makefile.in in lib_acl_cpp\samples and Makfile in lib_acl_cpp\samples\disque\ to find the build conditions.
157157
One Makefile as below:
158158
```Makefile

lib_acl_cpp/samples/redis/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ The header files of acl redis are in lib_acl_cpp\include\acl_cpp\redis; the sour
88
Because acl redis lib is a part of lib_acl_cpp lib, and lib_acl_cpp depend lib_acl and lib_protocol, you should compile lib_acl and lib_protocol libs first, and compile lib_acl_cpp lib. After you've compiled lib_acl_cpp lib, the redis lib is also compiled OK.
99

1010
### compile on UNIX/LINUX
11-
- 1 compile ** lib_acl.a **: Enter into lib_acl path and type make, the lib_acl.a will be compiled
12-
- 2 compile ** lib_protocol.a **: Enter into lib_protocol path and type make, the lib_protocol.a will be compiled
13-
- 3 compile ** lib_acl_cpp.a **: Enter into lib_acl_cpp path and type make, the lib_acl_cpp.a will be compiled
11+
- 1 compile `lib_acl.a`: Enter into *lib_acl* path and type make, the lib_acl.a will be compiled
12+
- 2 compile `lib_protocol.a`: Enter into *lib_protocol* path and type make, the lib_protocol.a will be compiled
13+
- 3 compile `lib_acl_cpp.a`: Enter into *lib_acl_cpp* path and type make, the lib_acl_cpp.a will be compiled
1414
- 4 compile redis samples: Enter into lib_acl_cpp\samples\redis and type make, all the redis samples(including redis_cluster, redis_connection, redis_hash, redis_hyperloglog, redis_key, redis_lib, redis_manager, redis_pool, redis_pubsub, redis_server, redis_set, redis_string, redis_trans, redis_zset, redis_zset_pool, redis_client_cluster) will be compiled.
1515

1616
### compile on WINDOWS
17-
You can use VC2003, VC2008, VC2010, VC2012 to build all acl libs including acl redis lib in lib_acl_cpp module when you open the acl projects(acl_cpp_vc2003.sln, acl_cpp_vc2008.sln, acl_cpp_vc2010.sln, acl_cpp_vc2012.sln). You should build lib_acl first, and second build lib_protocol, and third build lib_acl_cpp, and at last build all the acl samples including redis samples.
17+
You can use `VC2003`, `VC2008`, `VC2010`, `VC2012` to build all acl libs including acl redis lib in lib_acl_cpp module when you open the acl projects(acl_cpp_vc2003.sln, acl_cpp_vc2008.sln, acl_cpp_vc2010.sln, acl_cpp_vc2012.sln). You should build lib_acl first, and second build lib_protocol, and third build lib_acl_cpp, and at last build all the acl samples including redis samples.
1818

1919
## write some samples using acl redis lib
2020
### simple example for redis STRING and redis KEY:
@@ -214,7 +214,7 @@ int main(void)
214214
```
215215

216216
### add acl redis to your projects
217-
Before you use the acl redis, you should compile the three base libraries which redis depending on. Enter the lib_acl, lib_protocol, lib_acl_cpp, and build the ** lib_acl.a, lib_protocol.a and lib_acl_cpp.a **.
217+
Before you use the acl redis, you should compile the three base libraries which redis depending on. Enter the *lib_acl*, *lib_protocol*, *lib_acl_cpp*, and build the `lib_acl.a`, `lib_protocol.a` and `lib_acl_cpp.a`.
218218
```compile
219219
$cd lib_acl; make
220220
$cd lib_protocol; make

lib_acl_cpp/src/redis/redis_client.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ redis_result* redis_client::get_redis_error(dbuf_pool* pool)
9191
{
9292
buf_.clear();
9393
if (conn_.gets(buf_) == false)
94+
{
95+
logger_error("gets line error, server: %s", addr_);
9496
return NULL;
97+
}
9598

9699
redis_result* rr = new(pool) redis_result(pool);
97100
rr->set_type(REDIS_RESULT_ERROR);
@@ -105,7 +108,10 @@ redis_result* redis_client::get_redis_status(dbuf_pool* pool)
105108
{
106109
buf_.clear();
107110
if (conn_.gets(buf_) == false)
111+
{
112+
logger_error("gets line error, server: %s", addr_);
108113
return NULL;
114+
}
109115

110116
redis_result* rr = new(pool) redis_result(pool);
111117
rr->set_type(REDIS_RESULT_STATUS);
@@ -119,7 +125,10 @@ redis_result* redis_client::get_redis_integer(dbuf_pool* pool)
119125
{
120126
buf_.clear();
121127
if (conn_.gets(buf_) == false)
128+
{
129+
logger_error("gets line error, server: %s", addr_);
122130
return NULL;
131+
}
123132

124133
redis_result* rr = new(pool) redis_result(pool);
125134
rr->set_type(REDIS_RESULT_INTEGER);
@@ -133,7 +142,10 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
133142
{
134143
buf_.clear();
135144
if (conn_.gets(buf_) == false)
145+
{
146+
logger_error("gets line error, server: %s", addr_);
136147
return NULL;
148+
}
137149
redis_result* rr = new(pool) redis_result(pool);
138150
rr->set_type(REDIS_RESULT_STRING);
139151
int len = atoi(buf_.c_str());
@@ -147,14 +159,20 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
147159
rr->set_size(1);
148160
buf = (char*) pool->dbuf_alloc(len + 1);
149161
if (len > 0 && conn_.read(buf, (size_t) len) == -1)
162+
{
163+
logger_error("read data error, server: %s", addr_);
150164
return NULL;
165+
}
151166
buf[len] = 0;
152167
rr->put(buf, (size_t) len);
153168

154169
// 读 \r\n
155170
buf_.clear();
156171
if (conn_.gets(buf_) == false)
172+
{
173+
logger_error("gets line error, server: %s", addr_);
157174
return NULL;
175+
}
158176
return rr;
159177
}
160178

@@ -173,15 +191,21 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
173191
n = len > CHUNK_LENGTH - 1 ? CHUNK_LENGTH - 1 : len;
174192
buf = (char*) pool->dbuf_alloc((size_t) (n + 1));
175193
if (conn_.read(buf, (size_t) n) == -1)
194+
{
195+
logger_error("read data error, server: %s", addr_);
176196
return NULL;
197+
}
177198
buf[n] = 0;
178199
rr->put(buf, (size_t) n);
179200
len -= n;
180201
}
181202

182203
buf_.clear();
183204
if (conn_.gets(buf_) == false)
205+
{
206+
logger_error("gets line error, server: %s", addr_);
184207
return NULL;
208+
}
185209
return rr;
186210
}
187211

@@ -215,7 +239,7 @@ redis_result* redis_client::get_redis_object(dbuf_pool* pool)
215239
char ch;
216240
if (conn_.read(ch) == false)
217241
{
218-
logger_error("read first char error");
242+
logger_error("read first char error, server: %s", addr_);
219243
return NULL;
220244
}
221245

0 commit comments

Comments
 (0)