Skip to content

Commit

Permalink
minor refinement by clang-tidy
Browse files Browse the repository at this point in the history
Signed-off-by: Syrone Wong <[email protected]>
  • Loading branch information
wongsyrone committed Dec 31, 2019
1 parent 9fb84c0 commit 09b9612
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/session/serversession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void ServerSession::in_recv(const string &data) {
Log::log_with_endpoint(in_endpoint, "tunnel established");
status = FORWARD;
out_async_read();
if (out_write_buf != "") {
if (!out_write_buf.empty()) {
out_async_write(out_write_buf);
} else {
in_async_read();
Expand Down Expand Up @@ -320,7 +320,7 @@ void ServerSession::destroy() {
}
status = DESTROY;
Log::log_with_endpoint(in_endpoint, "disconnected, " + to_string(recv_len) + " bytes received, " + to_string(sent_len) + " bytes sent, lasted for " + to_string(time(NULL) - start_time) + " seconds", Log::INFO);
if (auth && auth_password.size() > 0) {
if (auth && !auth_password.empty()) {
auth->record(auth_password, recv_len, sent_len);
}
boost::system::error_code ec;
Expand Down

0 comments on commit 09b9612

Please sign in to comment.