Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pevernow authored and pevernow committed Aug 30, 2021
1 parent d3a165c commit bb619b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions deps/asio_kcp/client_lib/kcp_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,9 @@ std::string kcp_client::recv_udp_package_from_kcp(void)
{
char kcp_buf[MAX_MSG_SIZE] = "";
int kcp_recvd_bytes = ikcp_recv(p_kcp_, kcp_buf, sizeof(kcp_buf));
if (kcp_recvd_bytes < -1) {
spdlog::warn("Kcp_recvd_bytes<0: {}", kcp_recvd_bytes);
if (kcp_recvd_bytes < 0) {
if (kcp_recvd_bytes != -1)
spdlog::warn("Kcp_recvd_bytes<0: {}", kcp_recvd_bytes);
return "";
}

Expand Down
3 changes: 2 additions & 1 deletion deps/asio_kcp/server_lib/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ void connection::input(
char kcp_buf[1024 * 1000] = "";
int kcp_recvd_bytes = ikcp_recv(p_kcp_, kcp_buf, sizeof(kcp_buf));
if (kcp_recvd_bytes <= 0) {
spdlog::warn("Kcp_recvd_bytes<=0: {}", kcp_recvd_bytes);
if (kcp_recvd_bytes != -1)
spdlog::warn("Kcp_recvd_bytes<=0: {}", kcp_recvd_bytes);
} else {
const std::string package(kcp_buf, kcp_recvd_bytes);
/*
Expand Down

0 comments on commit bb619b0

Please sign in to comment.