optimize codes.

This commit is contained in:
zhengshuxin 2023-03-20 17:01:23 +08:00
parent 639e1af308
commit 62107801c1
4 changed files with 9 additions and 4 deletions

View File

@ -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:
/*

View File

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

View File

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

View File

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