Skip to content

Commit

Permalink
acl.3.0.19 版本发布
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengshuxin committed Jun 23, 2014
1 parent 6a94a8f commit 8e5ae88
Show file tree
Hide file tree
Showing 24 changed files with 210 additions and 90 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.0.17
VERSION = 3.0.19

help:
@(echo "usage: make help|all|clean|install|uninstall|uninstall_all|build_bin|build_src")
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ session manager<br>
unit test framework<br>

website: <a href=http://www.iteye.com/ target=_blank>http://www.iteye.com/</a><br>
bbs: <a href=http://www.aclfans.com/ target=_blank>http://www.aclfans.com</a><br>
download: <a href=https://sourceforge.net/projects/acl/ target=_blank>https://sourceforge.net/projects/acl/</a><br>
qq group: 242722074<br>
2 changes: 2 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
�޸���ʷ�б���
------------------------------------------------------------------------
71) 2014.6.23 --- acl 3.0.19 �汾������

70) 2014.5.27
70.1) �����˹��� VC2003, VC2008, VC2010, VC2012

Expand Down
6 changes: 6 additions & 0 deletions lib_acl/changes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
�޸���ʷ�б���

------------------------------------------------------------------------
449) 2014.6.23
449.1) acl_aio_server.c: ��������֮ǰ���ܼ����Խӿ�

448) 2014.6.20
448.1) acl_aio_server.c: ������ IP ��ַ���ƹ���

447) 2014.6.17
447.1) master/template: ������һ�¸�ģ��Ĵ���
447.2) removed: ȥ���� acl_aio_app_main.c�����书�ܺϲ��� acl_aio_server.c �У�
Expand Down
9 changes: 9 additions & 0 deletions lib_acl/include/master/acl_server_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ typedef void (*ACL_AIO_SERVER2_FN) (ACL_SOCKET, void *);

void acl_aio_server_main(int, char **, ACL_AIO_SERVER_FN, ...);
void acl_aio_server2_main(int, char **, ACL_AIO_SERVER2_FN, ...);

typedef int (*ACL_AIO_RUN_FN)(ACL_ASTREAM *stream, void *run_ctx);
typedef int (*ACL_AIO_RUN2_FN)(ACL_SOCKET fd, void *run_ctx);

ACL_DEPRECATED void acl_aio_app_main(int argc, char *argv[],
ACL_AIO_RUN_FN run_fn, void *run_ctx, ...);
ACL_DEPRECATED void acl_aio_app2_main(int argc, char *argv[],
ACL_AIO_RUN2_FN run2_fn, void *run_ctx, ...);

void acl_aio_server_request_timer(ACL_EVENT_NOTIFY_TIME timer_fn,
void *arg, int delay);
void acl_aio_server_cancel_timer(ACL_EVENT_NOTIFY_TIME timer_fn, void *arg);
Expand Down
14 changes: 6 additions & 8 deletions lib_acl/lib_acl.rc
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// ??(???????) resources
// ����(���壬�й�) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
#ifdef _WIN32
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
#pragma code_page(936)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -53,8 +51,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,0,1,7
PRODUCTVERSION 3,0,1,7
FILEVERSION 3,0,19,0
PRODUCTVERSION 3,0,19,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -71,12 +69,12 @@ BEGIN
BEGIN
VALUE "Comments", "����Ϊ��ƽ̨��C�⣬����������ͨѶ����������ܵȹ���"
VALUE "FileDescription", "acl ��"
VALUE "FileVersion", "3, 0, 1, 7"
VALUE "FileVersion", "3.0.19.0"
VALUE "InternalName", "lib_acl"
VALUE "LegalCopyright", "zsx (C) 2011"
VALUE "OriginalFilename", "lib_acl.lib"
VALUE "ProductName", " acl ��"
VALUE "ProductVersion", "3, 0, l, 7"
VALUE "ProductVersion", "3, 0, l, 9"
END
END
BLOCK "VarFileInfo"
Expand All @@ -85,7 +83,7 @@ BEGIN
END
END

#endif // ??(???????) resources
#endif // ����(���壬�й�) resources
/////////////////////////////////////////////////////////////////////////////


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 = "lib_acl_3.0.18";
static char *version = "lib_acl_3.0.19";

const char *acl_version(void)
{
Expand Down
66 changes: 60 additions & 6 deletions lib_acl/src/master/template/acl_aio_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,6 @@ static void usage(int argc, char *argv[])
acl_msg_info("usage: %s -h[help]"
" -c [use chroot]"
" -d [debug]"
" -l [run alone]"
" -n service_name"
" -s socket_count"
" -i [use stdin]"
Expand Down Expand Up @@ -1222,7 +1221,7 @@ static void server_main(int argc, char **argv, va_list ap)
{
const char *myname = "acl_aio_server_main";
ACL_VSTREAM *stream = 0;
int key, f_flag = 0, alone = 0;
int key, f_flag = 0;
char *root_dir = 0, *user_name = 0;
char *service_name = acl_mystrdup(acl_safe_basename(argv[0]));
ACL_MASTER_SERVER_INIT_FN pre_init = 0;
Expand Down Expand Up @@ -1254,7 +1253,7 @@ static void server_main(int argc, char **argv, va_list ap)

opterr = 0;

while ((key = getopt(argc, argv, "hcdlm:n:o:s:it:uvzf:")) > 0) {
while ((key = getopt(argc, argv, "hcdm:n:o:s:it:uvzf:")) > 0) {
switch (key) {
case 'h':
usage(argc, argv);
Expand All @@ -1267,9 +1266,6 @@ static void server_main(int argc, char **argv, va_list ap)
case 'c':
root_dir = "setme";
break;
case 'l':
alone = 1;
break;
case 'n':
service_name = optarg;
break;
Expand Down Expand Up @@ -1387,6 +1383,10 @@ static void server_main(int argc, char **argv, va_list ap)
acl_msg_fatal("chdir(\"%s\"): %s", acl_var_aio_queue_dir,
acl_last_serror());

/* 增加 ip 地址限制 */
if (acl_var_aio_access_allow && *acl_var_aio_access_allow)
acl_access_add(acl_var_aio_access_allow, ", \t", ":");

/* Run pre-jail initialization. */
if (pre_init)
pre_init(__service_ctx);
Expand Down Expand Up @@ -1437,4 +1437,58 @@ void acl_aio_server2_main(int argc, char **argv, ACL_AIO_SERVER2_FN service,...)
server_main(argc, argv, ap);
}

/****************************************************************************/

static ACL_AIO_RUN_FN __app_run;

static void service_adapter(ACL_ASTREAM *astream, void *ctx)
{
const char *myname = "service_adapter";

if (__app_run) {
if (__app_run(astream, ctx) != 0)
acl_aio_iocp_close(astream);
} else
acl_msg_error("%s(%d): __app_run null", myname, __LINE__);
}

void acl_aio_app_main(int argc, char *argv[], ACL_AIO_RUN_FN run_fn,
void *run_ctx, ...)
{
va_list ap;

va_start(ap, run_ctx);
__service_main = service_adapter;
__app_run = run_fn;
__service_ctx = run_ctx;

server_main(argc, argv, ap);
}

static ACL_AIO_RUN2_FN __app2_run;

static void service_adapter2(ACL_SOCKET fd, void *ctx)
{
const char *myname = "service_adapter";

if (__app2_run) {
if (__app2_run(fd, ctx) != 0)
acl_socket_close(fd);
} else
acl_msg_error("%s(%d): __app2_run null", myname, __LINE__);
}

void acl_aio_app2_main(int argc, char *argv[], ACL_AIO_RUN2_FN run2_fn,
void *run_ctx, ...)
{
va_list ap;

va_start(ap, run_ctx);
__service2_main = service_adapter2;
__app2_run = run2_fn;
__service_ctx = run_ctx;

server_main(argc, argv, ap);
}

#endif /* ACL_UNIX */
11 changes: 1 addition & 10 deletions lib_acl/src/master/template/acl_multi_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ static void usage(int argc, char *argv[])
acl_msg_info("usage: %s -h[help]"
" -c [use chroot]"
" -d [debug]"
" -l [run alone]"
" -n service_name"
" -s socket_count"
" -i [use stdin]"
Expand Down Expand Up @@ -521,8 +520,6 @@ void acl_multi_server_main(int argc, char **argv, ACL_MULTI_SERVER_FN service,..
ACL_MASTER_SERVER_LOOP_FN loop = 0;
int key;
char *transport = 0;
int alone = 0;
int zerolimit = 0;
ACL_WATCHDOG *watchdog;
char *generation;
int fd, i, fdtype = 0;
Expand All @@ -539,7 +536,7 @@ void acl_multi_server_main(int argc, char **argv, ACL_MULTI_SERVER_FN service,..
* stderr, because no-one is going to see them.
*/
opterr = 0;
while ((c = getopt(argc, argv, "hcdlm:n:s:it:uvzf:")) > 0) {
while ((c = getopt(argc, argv, "hcdm:n:s:it:uvf:")) > 0) {
switch (c) {
case 'h':
usage(argc, argv);
Expand All @@ -552,9 +549,6 @@ void acl_multi_server_main(int argc, char **argv, ACL_MULTI_SERVER_FN service,..
case 'c':
root_dir = "setme";
break;
case 'l':
alone = 1;
break;
case 'n':
service_name = optarg;
break;
Expand All @@ -574,9 +568,6 @@ void acl_multi_server_main(int argc, char **argv, ACL_MULTI_SERVER_FN service,..
case 'v':
acl_msg_verbose++;
break;
case 'z':
zerolimit = 1;
break;
default:
break;
}
Expand Down
2 changes: 2 additions & 0 deletions lib_acl_cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ clean:
rm -f $(OBJS_DEF)
@(cd samples; make clean)

rebuild rb: clean static

build_src: clean
@(echo "begin building src release...")
@(rm -rf acl_cpp)
Expand Down
2 changes: 2 additions & 0 deletions lib_acl_cpp/Makefile.db
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ clean:
rm -f $(OBJS_DEF)
@(cd samples; make clean)

rebuild rb: clean static

build_src: clean
@(echo "begin building src release...")
@(rm -rf acl_cpp)
Expand Down
4 changes: 4 additions & 0 deletions lib_acl_cpp/changes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
�޸���ʷ�б���
------------------------------------------------------------------------
242) 2014.6.23
242.1) feature: string.cpp �� string ֧����ֵ��ֵ����

------------------------------------------------------------------------
241) 2014.6.18
241.1) master_aio.cpp: �����������в�Ӧ�ٵ��� __handle->check()
Expand Down
20 changes: 18 additions & 2 deletions lib_acl_cpp/include/acl_cpp/stdlib/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ACL_CPP_API string
* 则产生断言
* @return {char} 返回指定位置的字符
*/
char operator[](size_t n);
char operator[](size_t n) const;

/**
* 根据字符数组下标获得指定位置的字符,输入参数必须为合法值,否则则
Expand All @@ -77,7 +77,23 @@ class ACL_CPP_API string
* 则产生断言
* @return {char} 返回指定位置的字符
*/
char operator[](int n);
char operator[](int n) const;

/**
* 左值赋值重载,用户可以直接使用对象的数组下标进行赋值,如果下标组值
* 越界,则内部直接产生断言
* @param n {size_t} 数组下标位置
* @return {char&}
*/
char& operator[](size_t n);

/**
* 左值赋值重载,用户可以直接使用对象的数组下标进行赋值,如果下标组值
* 越界,则内部直接产生断言
* @param n {int} 数组下标位置
* @return {char&}
*/
char& operator[](int n);

/**
* 对目标字符串类对象赋值
Expand Down
19 changes: 10 additions & 9 deletions lib_acl_cpp/samples/master_aio_proxy/master_aio_proxy.cf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ service master_aio_proxy {
# for master_type = unix
# master_service = aio_echo.sock
# for master_type = sock
master_service = 5200, 127.0.0.1:5100, :5300, aio_echo.sock, aio_echo2.sock
# master_service = 5200, 127.0.0.1:5100, :5300, aio_echo.sock, aio_echo2.sock
master_service = 5200

# �������Ϊ���׽ӿ�
# master_service = aio_echo.sock
Expand Down Expand Up @@ -75,13 +76,13 @@ service master_aio_proxy {
# ��λΪ΢��
aio_delay_usec = 500
# �����¼�ѭ���ķ�ʽ: select(default), poll, kernel(epoll/devpoll/kqueue)
aio_event_mode = select
aio_event_mode = kernel
# �Ƿ� socket ������IO���ֿܷ�: yes/no, ���Ϊ yes ���Դ����� accept() �ٶ�
aio_accept_alone = yes
# �̳߳ص�����߳���, �����ֵΪ0���ʾ���õ��̷߳�����ģʽ.
aio_max_threads = 0
# ÿ���̵߳Ŀ���ʱ��.
aio_thread_idle_limit = 60
# aio_thread_idle_limit = 60

# ������ master_dispatch ���ӷֿ�����󣬸�����ָ�� master_dispatch ��������
# ���׽ӿڵ�ȫ·�����������ӽ��̾Ϳ��Դ� master_dispatch ��ÿͻ�������
Expand All @@ -97,11 +98,11 @@ service master_aio_proxy {
############################################################################
# Ӧ���Լ�������ѡ��

# ÿ���ͻ������ӵĿ���ʱ��.
client_idle_limit = 60
# �Ƿ������ǰ���ڴ�״̬��Ϣ
debug_mem = 1
# �Ƿ��ͻ�ӭ��Ϣ
send_banner = 0
# ��˷�������ַ����ʽ��ip:port
backend_addr = 127.0.0.1:8080
# ��������ת���ļ�
# request_file = {install_path}/var/log/request.dat
# ��Ӧ����ת���ļ�
# respond_file = {install_path}/var/log/response.dat
}

Loading

0 comments on commit 8e5ae88

Please sign in to comment.