Skip to content

Commit

Permalink
fixed one urgent bug in acl_read_wait
Browse files Browse the repository at this point in the history
  • Loading branch information
ubuntu14 committed Dec 21, 2015
1 parent 835e3a2 commit 67e6bd0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
4 changes: 4 additions & 0 deletions app/wizard/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
9) 2015.12.21
9.1) bugfix: master_threads.cpp �еĺ��� proc_exit_timer ��ֻ�е� nclients Ϊ0
ʱ�������˳�

8) 2015.6.22
8.1) comment: �����ɵķ����������е� main Դ������������ע�ͣ�ָ��ʹ�÷���

Expand Down
2 changes: 1 addition & 1 deletion app/wizard/tmpl/http/master_threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void master_service::proc_on_exit()

bool master_service::proc_exit_timer(size_t nclients, size_t nthreads)
{
if (nclients == 0 || nthreads == 0)
if (nclients == 0)
{
logger("clients count: %d, threads count: %d",
(int) nclients, (int) nthreads);
Expand Down
2 changes: 1 addition & 1 deletion app/wizard/tmpl/master/master_threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void master_service::proc_on_init()

bool master_service::proc_exit_timer(size_t nclients, size_t nthreads)
{
if (nclients == 0 || nthreads == 0)
if (nclients == 0)
{
logger("clients count: %d, threads count: %d",
(int) nclients, (int) nthreads);
Expand Down
1 change: 1 addition & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
�޸���ʷ�б���
------------------------------------------------------------------------
92) 2015.12.21 --- acl 3.1.4.2 �汾������(�޸���һ������ BUG)
91) 2015.12.21 --- acl 3.1.4.1 �汾������(�޸��˼������� BUG)
90) 2015.12.20 --- acl 3.1.4 �汾������
89) 2015.11.4
Expand Down
1 change: 1 addition & 0 deletions lib_acl/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
����ϵͳ API read��������γ���ѭ��
520.2) bugfix: event �¼�����Ӧ�����ּ��������ֺ�һ���׽��֣��еĵط�δ��
�����׽��� listener �� 1�������������ѭ��
520.3) bugfix: acl_read_wait ������ʹ�� epoll �ķ�ʽ�����⣬�������ѭ��

519) 2015.12.20
519.1) feature: acl_aio.c ���������ü�������׽���״̬��ʱ��������
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.4";
static char *version = "acl_3.1.4.2";

const char *acl_version(void)
{
Expand Down
12 changes: 6 additions & 6 deletions lib_acl/src/stdlib/iostuff/acl_read_wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ int acl_read_wait(ACL_SOCKET fd, int timeout)
}

for (;;) {
switch (epoll_wait(*epoll_fd, events, 1, delay)) {
case -1:
if (acl_last_error() == ACL_EINTR)
{
ret = epoll_wait(*epoll_fd, events, 1, delay);

if (ret == -1) {
if (acl_last_error() == ACL_EINTR) {
acl_msg_warn(">>>>catch EINTR, try again<<<");
continue;
}
Expand All @@ -99,11 +99,11 @@ int acl_read_wait(ACL_SOCKET fd, int timeout)
myname, __LINE__, acl_last_serror(), fd);
ret = -1;
break;
case 0:
} else if (ret == 0) {
acl_set_error(ACL_ETIMEDOUT);
ret = -1;
break;
default:
} else {
if ((events[0].events & (EPOLLERR | EPOLLHUP)) != 0)
ret = -1;
else if ((events[0].events & EPOLLIN) == 0) {
Expand Down

0 comments on commit 67e6bd0

Please sign in to comment.