mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-11-30 02:47:56 +08:00
optimize codes.
This commit is contained in:
parent
639e1af308
commit
62107801c1
@ -339,9 +339,11 @@ int acl_read_poll_wait(ACL_SOCKET fd, int delay)
|
||||
if (acl_last_error() == ACL_EINTR) {
|
||||
break;
|
||||
}
|
||||
/*
|
||||
acl_msg_error("%s(%d), %s: poll error(%s), fd: %d",
|
||||
__FILE__, __LINE__, myname,
|
||||
acl_last_serror(), (int) fd);
|
||||
*/
|
||||
return -1;
|
||||
case 0:
|
||||
/*
|
||||
|
@ -409,8 +409,8 @@ bool websocket::read_frame_head(void)
|
||||
|
||||
if (client_.read(buf, 2) == -1) {
|
||||
if (last_error() != ACL_ETIMEDOUT) {
|
||||
logger_error("read first two char error: %d, %s",
|
||||
last_error(), last_serror());
|
||||
//logger_error("read first two char error: %d, %s",
|
||||
// last_error(), last_serror());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -39,7 +39,9 @@ void redis_command::init(void)
|
||||
result_ = NULL;
|
||||
pipe_msg_ = NULL;
|
||||
addr_[0] = 0;
|
||||
dbuf_ = new dbuf_pool();
|
||||
|
||||
#define REDIS_DBUF_NBLOCK 1
|
||||
dbuf_ = new (REDIS_DBUF_NBLOCK) dbuf_pool();
|
||||
}
|
||||
|
||||
redis_command::redis_command(void)
|
||||
|
@ -448,7 +448,8 @@ json::json(const char* data /* NULL */, dbuf_guard* dbuf /* NULL */)
|
||||
if (dbuf) {
|
||||
dbuf_ = dbuf;
|
||||
} else {
|
||||
dbuf_ = dbuf_internal_ = NEW dbuf_guard;
|
||||
#define JSON_DBUF_NBLOCK 1
|
||||
dbuf_ = dbuf_internal_ = NEW dbuf_guard(JSON_DBUF_NBLOCK);
|
||||
}
|
||||
|
||||
json_ = acl_json_dbuf_alloc(dbuf_->get_dbuf().get_dbuf());
|
||||
|
Loading…
Reference in New Issue
Block a user