fixed one urgent bug in acl_read_wait

This commit is contained in:
ubuntu14 2015-12-21 23:53:55 +08:00
parent 835e3a215f
commit 67e6bd0470
7 changed files with 15 additions and 9 deletions

View File

@ -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 源程序中增加了注释,指明使用方法

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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 增加了设置检查所有套接字状态的时间间隔函数

View File

@ -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)
{

View File

@ -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;
}
@ -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) {