Skip to content

Commit

Permalink
optimize codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengshuxin committed Mar 20, 2023
1 parent 639e1af commit 6210780
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib_acl/src/stdlib/iostuff/acl_read_wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/*
Expand Down
4 changes: 2 additions & 2 deletions lib_acl_cpp/src/http/websocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion lib_acl_cpp/src/redis/redis_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion lib_acl_cpp/src/stdlib/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 6210780

Please sign in to comment.