From f19754678588a7e86cfecc2d45586290e5f3cb2b Mon Sep 17 00:00:00 2001 From: doleyzi <43397300+doleyzi@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:15:13 +0800 Subject: [PATCH] [INLONG-9044][SDK] Add server response log to facilitate troubleshooting (#9045) --- .../dataproxy-sdk-cpp/src/client/tcp_client.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-cpp/src/client/tcp_client.cc b/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-cpp/src/client/tcp_client.cc index 6231f08518a..8a2a583b3b7 100644 --- a/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-cpp/src/client/tcp_client.cc +++ b/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-cpp/src/client/tcp_client.cc @@ -167,15 +167,15 @@ void TcpClient::OnWroten(const asio::error_code error, // operation aborted return; } - LOG_ERROR("write error:" << error.message() << CLIENT_INFO); status_ = kWriting; + LOG_ERROR("write error:" << error.message() << CLIENT_INFO); HandleFail(); return; } if (0 == bytes_transferred) { - LOG_ERROR("transferred 0 bytes." << CLIENT_INFO); status_ = kWaiting; + LOG_ERROR("transferred 0 bytes." << CLIENT_INFO); HandleFail(); return; } @@ -201,6 +201,7 @@ void TcpClient::OnReturn(asio::error_code error, std::size_t len) { } if (len != sizeof(uint32_t)) { status_ = kWaiting; + LOG_ERROR("len :" << len <<" != sizeof(uint32_t):" < recv_buf_->m_max_size) { status_ = kWaiting; + LOG_ERROR("invalid resp_len :" << resp_len << CLIENT_INFO); HandleFail(); return; }