Skip to content

Commit

Permalink
acl 3.1.2 version released
Browse files Browse the repository at this point in the history
  • Loading branch information
ubuntu14 committed May 9, 2015
1 parent dd45047 commit ab5ec2e
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ endif
##############################################################################

.PHONY = check help all clean install uninstall uninstall_all build_bin build_src
VERSION = 3.1.0
VERSION = 3.1.2

help:
@(echo "usage: make help|all|clean|install|uninstall|uninstall_all|build_bin|build_src")
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ acl
- 13 queue: 磁盘文件队列操作库
- 14 ipc: 阻塞/非阻塞通信整合库
- 15 session: HTTP 会话库
- 16 redis: 完整实现了 redis 协议的客户端通信库(总共 12 个大类,150 多个命令),支持连接池及连接池集群管理
- **16 redis: 完整实现了 redis 协议的客户端通信库(总共 12 个大类,150 多个命令),支持连接池及连接池集群管理**
- 17 disque: 支持集群消息队列服务 disque 的客户端库,支持连接池及连接池集群管理

### 3.4、图例
* 类索引图:
Expand Down
1 change: 1 addition & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
�޸���ʷ�б���
------------------------------------------------------------------------
86) 2015.5.9 --- acl 3.1.2 �汾������
85) 2015.5.5
85.1) lib_acl_cpp/samples/disque: ���Էֲ�ʽ��Ϣ���� disque �ͻ��˿�����

Expand Down
2 changes: 1 addition & 1 deletion lib_acl/src/init/acl_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "init.h"

static char *version = "acl_3.1.1";
static char *version = "acl_3.1.2";

const char *acl_version(void)
{
Expand Down
4 changes: 2 additions & 2 deletions lib_acl_cpp/samples/disque/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int main(void)
```

### add acl disque to your projects
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.
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`.
```compile
$cd lib_acl; make
$cd lib_protocol; make
Expand All @@ -152,7 +152,7 @@ $cd lib_acl_cpp; make
In your Makefile, you should add below compiling flags:
-DLINUX2 for LINUX, -DFREEBSD for FreeBSD, -DMACOSX for MAXOS, -DSUNOS5 for Solaris X86;
-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;
At last, link with ** -L{path_to_acl_cpp} -l_acl_cpp -L{path_to_protocol} -l_protocol -L{path_to_acl) -l_acl **
At last, link with `-L{path_to_acl_cpp} -l_acl_cpp -L{path_to_protocol} -l_protocol -L{path_to_acl) -l_acl`
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.
One Makefile as below:
```Makefile
Expand Down
10 changes: 5 additions & 5 deletions lib_acl_cpp/samples/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ The header files of acl redis are in lib_acl_cpp\include\acl_cpp\redis; the sour
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.

### compile on UNIX/LINUX
- 1 compile ** lib_acl.a **: Enter into lib_acl path and type make, the lib_acl.a will be compiled
- 2 compile ** lib_protocol.a **: Enter into lib_protocol path and type make, the lib_protocol.a will be compiled
- 3 compile ** lib_acl_cpp.a **: Enter into lib_acl_cpp path and type make, the lib_acl_cpp.a will be compiled
- 1 compile `lib_acl.a`: Enter into *lib_acl* path and type make, the lib_acl.a will be compiled
- 2 compile `lib_protocol.a`: Enter into *lib_protocol* path and type make, the lib_protocol.a will be compiled
- 3 compile `lib_acl_cpp.a`: Enter into *lib_acl_cpp* path and type make, the lib_acl_cpp.a will be compiled
- 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.

### compile on WINDOWS
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.
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.

## write some samples using acl redis lib
### simple example for redis STRING and redis KEY:
Expand Down Expand Up @@ -214,7 +214,7 @@ int main(void)
```

### add acl redis to your projects
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 **.
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`.
```compile
$cd lib_acl; make
$cd lib_protocol; make
Expand Down
26 changes: 25 additions & 1 deletion lib_acl_cpp/src/redis/redis_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ redis_result* redis_client::get_redis_error(dbuf_pool* pool)
{
buf_.clear();
if (conn_.gets(buf_) == false)
{
logger_error("gets line error, server: %s", addr_);
return NULL;
}

redis_result* rr = new(pool) redis_result(pool);
rr->set_type(REDIS_RESULT_ERROR);
Expand All @@ -105,7 +108,10 @@ redis_result* redis_client::get_redis_status(dbuf_pool* pool)
{
buf_.clear();
if (conn_.gets(buf_) == false)
{
logger_error("gets line error, server: %s", addr_);
return NULL;
}

redis_result* rr = new(pool) redis_result(pool);
rr->set_type(REDIS_RESULT_STATUS);
Expand All @@ -119,7 +125,10 @@ redis_result* redis_client::get_redis_integer(dbuf_pool* pool)
{
buf_.clear();
if (conn_.gets(buf_) == false)
{
logger_error("gets line error, server: %s", addr_);
return NULL;
}

redis_result* rr = new(pool) redis_result(pool);
rr->set_type(REDIS_RESULT_INTEGER);
Expand All @@ -133,7 +142,10 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
{
buf_.clear();
if (conn_.gets(buf_) == false)
{
logger_error("gets line error, server: %s", addr_);
return NULL;
}
redis_result* rr = new(pool) redis_result(pool);
rr->set_type(REDIS_RESULT_STRING);
int len = atoi(buf_.c_str());
Expand All @@ -147,14 +159,20 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
rr->set_size(1);
buf = (char*) pool->dbuf_alloc(len + 1);
if (len > 0 && conn_.read(buf, (size_t) len) == -1)
{
logger_error("read data error, server: %s", addr_);
return NULL;
}
buf[len] = 0;
rr->put(buf, (size_t) len);

// 读 \r\n
buf_.clear();
if (conn_.gets(buf_) == false)
{
logger_error("gets line error, server: %s", addr_);
return NULL;
}
return rr;
}

Expand All @@ -173,15 +191,21 @@ redis_result* redis_client::get_redis_string(dbuf_pool* pool)
n = len > CHUNK_LENGTH - 1 ? CHUNK_LENGTH - 1 : len;
buf = (char*) pool->dbuf_alloc((size_t) (n + 1));
if (conn_.read(buf, (size_t) n) == -1)
{
logger_error("read data error, server: %s", addr_);
return NULL;
}
buf[n] = 0;
rr->put(buf, (size_t) n);
len -= n;
}

buf_.clear();
if (conn_.gets(buf_) == false)
{
logger_error("gets line error, server: %s", addr_);
return NULL;
}
return rr;
}

Expand Down Expand Up @@ -215,7 +239,7 @@ redis_result* redis_client::get_redis_object(dbuf_pool* pool)
char ch;
if (conn_.read(ch) == false)
{
logger_error("read first char error");
logger_error("read first char error, server: %s", addr_);
return NULL;
}

Expand Down

0 comments on commit ab5ec2e

Please sign in to comment.