From 46ffe105a6a96489ba41ab67ead94599a9a69bb6 Mon Sep 17 00:00:00 2001 From: luciferWei Date: Tue, 10 Jun 2025 17:31:49 +0800 Subject: [PATCH 01/10] =?UTF-8?q?Feat=EF=BC=9A=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=20=20\nSigned-off-by:=20LuciferWei=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/base.cpp | 3 +++ src/common/define_enum.h | 4 +-- src/common/server_cmd_log.cpp | 11 ++++++++ src/common/server_cmd_log.h | 3 +++ src/common/session.cpp | 2 +- src/host/host_tcp.cpp | 2 +- src/host/server.cpp | 10 ++++---- .../testModule/test_hdc_return_value_check.py | 25 +++++++++---------- test/unittest/common/include/define_ut.h | 1 + 9 files changed, 39 insertions(+), 22 deletions(-) diff --git a/src/common/base.cpp b/src/common/base.cpp index fac3bbe4..3c6c16b2 100644 --- a/src/common/base.cpp +++ b/src/common/base.cpp @@ -2978,6 +2978,9 @@ void CloseOpenFd(void) ThreadProcessCmdLogs(); } std::this_thread::sleep_for(std::chrono::seconds(1)); + if (false == Hdc::ServerCmdLog::GetInstance().GetRunningStatus()) { + break; + } } } diff --git a/src/common/define_enum.h b/src/common/define_enum.h index 5ce4d155..93735756 100644 --- a/src/common/define_enum.h +++ b/src/common/define_enum.h @@ -23,7 +23,7 @@ enum MessageLevel { }; enum ConnType { CONN_USB = 0, CONN_TCP, CONN_SERIAL, CONN_BT, CONN_UNKNOWN }; -const std::string conTypeDetail[] = { "USB", "TCP", "UART", "BT", "UNKNOWN" }; +const std::string ConTypeDetail[] = { "USB", "TCP", "UART", "BT", "UNKNOWN" }; #ifdef HDC_SUPPORT_UART enum UartTimeConst { @@ -51,7 +51,7 @@ enum UartSetSerialNStop { }; #endif enum ConnStatus { STATUS_UNKNOW = 0, STATUS_READY, STATUS_CONNECTED, STATUS_OFFLINE, STATUS_UNAUTH }; -const std::string conStatusDetail[] = { "Unknown", "Ready", "Connected", "Offline", "Unauthorized" }; +const std::string ConStatusDetail[] = { "Unknown", "Ready", "Connected", "Offline", "Unauthorized" }; enum AuthVerifyType { RSA_ENCRYPT = 0, RSA_3072_SHA512 = 1, UNKNOWN = 100 }; diff --git a/src/common/server_cmd_log.cpp b/src/common/server_cmd_log.cpp index 9bb6b8ca..057b6a95 100644 --- a/src/common/server_cmd_log.cpp +++ b/src/common/server_cmd_log.cpp @@ -27,6 +27,7 @@ ServerCmdLog& ServerCmdLog::GetInstance() ServerCmdLog::ServerCmdLog() { lastFlushTime = std::chrono::system_clock::now(); + running_ = true; } ServerCmdLog::~ServerCmdLog() @@ -68,4 +69,14 @@ std::chrono::system_clock::time_point ServerCmdLog::GetLastFlushTime() return lastFlushTime; } +bool ServerCmdLog::GetRunningStatus() +{ + return running_; +} + +void ServerCmdLog::SetRunningStatus(bool running) +{ + running_ = running; +} + } // namespace Hdc \ No newline at end of file diff --git a/src/common/server_cmd_log.h b/src/common/server_cmd_log.h index 038c7223..042eafb6 100644 --- a/src/common/server_cmd_log.h +++ b/src/common/server_cmd_log.h @@ -28,8 +28,11 @@ public: std::string PopCmdLogStr(); size_t CmdLogStrSize(); std::chrono::system_clock::time_point GetLastFlushTime(); + bool GetRunningStatus(); + void SetRunningStatus(bool running); private: + bool running_ = false; std::chrono::system_clock::time_point lastFlushTime = std::chrono::system_clock::now(); std::mutex pushCmdLogStrRecordMutex; std::queue pushCmdLogStrQueue; diff --git a/src/common/session.cpp b/src/common/session.cpp index f2d9e354..f99fd8b6 100755 --- a/src/common/session.cpp +++ b/src/common/session.cpp @@ -587,7 +587,7 @@ void HdcSessionBase::FreeSessionFinally(uv_idle_t *handle) thisClass->NotifyInstanceSessionFree(hSession, true); #ifdef HDC_HOST thisClass->AdminSession(OP_PRINT, hSession->sessionId, nullptr); -#endif +#endif // all hsession uv handle has been clear thisClass->AdminSession(OP_REMOVE, hSession->sessionId, nullptr); WRITE_LOG(LOG_INFO, "!!!FreeSessionFinally sessionId:%u finish", hSession->sessionId); diff --git a/src/host/host_tcp.cpp b/src/host/host_tcp.cpp index f0af20db..8deb0e32 100644 --- a/src/host/host_tcp.cpp +++ b/src/host/host_tcp.cpp @@ -106,7 +106,7 @@ void HdcHostTCP::Connect(uv_connect_t *connection, int status) hSession->isRunningOk = false; char buffer[BUF_SIZE_DEFAULT] = { 0 }; uv_strerror_r(status, buffer, BUF_SIZE_DEFAULT); - hSession->faultInfo += buffer; + hSession->faultInfo += buffer; goto Finish; } if ((hSession->fdChildWorkTCP = Base::DuplicateUvSocket(&hSession->hWorkTCP)) < 0) { diff --git a/src/host/server.cpp b/src/host/server.cpp index 499944d5..7c203de0 100644 --- a/src/host/server.cpp +++ b/src/host/server.cpp @@ -232,17 +232,17 @@ void HdcServer::ClearMapDaemonInfo() void HdcServer::BuildDaemonVisableLine(HDaemonInfo hdi, bool fullDisplay, string &out) { if (fullDisplay) { - string sConn = conTypeDetail[CONN_UNKNOWN]; + string sConn = ConTypeDetail[CONN_UNKNOWN]; if (hdi->connType < CONN_UNKNOWN) { - sConn = conTypeDetail[hdi->connType]; + sConn = ConTypeDetail[hdi->connType]; } - string sStatus = conStatusDetail[STATUS_UNKNOW]; + string sStatus = ConStatusDetail[STATUS_UNKNOW]; if (hdi->connStatus < STATUS_UNAUTH) { if (hdi->connStatus == STATUS_CONNECTED && hdi->daemonAuthStatus == DAEOMN_UNAUTHORIZED) { - sStatus = conStatusDetail[STATUS_UNAUTH]; + sStatus = ConStatusDetail[STATUS_UNAUTH]; } else { - sStatus = conStatusDetail[hdi->connStatus]; + sStatus = ConStatusDetail[hdi->connStatus]; } } diff --git a/test/scripts/testModule/test_hdc_return_value_check.py b/test/scripts/testModule/test_hdc_return_value_check.py index a10d345a..e68c9c0e 100644 --- a/test/scripts/testModule/test_hdc_return_value_check.py +++ b/test/scripts/testModule/test_hdc_return_value_check.py @@ -47,10 +47,20 @@ class TestHdcReturnValue: return size == first_line_size + content_size + @staticmethod + def compare_line_with_result(line, result_lines, index): + while len(result_lines[index]) == 0: + index += 1 + if index >= len(result_lines): + return True + if line != result_lines[index]: + logger.warning(f"line:{line}, result line:{result_lines[index]}") + return False + return True + """ hdc help命令的输出与hdc.log文件内容非空行逐行比较,全部相等则成功 """ - @pytest.mark.L0 def test_hdc_help(self): result = get_shell_result(f"help") @@ -60,16 +70,9 @@ class TestHdcReturnValue: with open(help_file, 'r') as file: for line in file.readlines(): line = line.replace("\n", "") - while len(result_lines[index]) == 0: - index = index + 1 - if index >= len(result_lines): - return if line: - if line != result_lines[index]: - logger.warning(f"line:{line}, result line:{result_lines[index]}") + if (False is self.compare_line_with_result(line, result_lines, index)): assert False - return - index = index + 1 return """ @@ -145,10 +148,6 @@ class TestHdcReturnValue: def test_hdc_target_boot(self): assert check_shell(f"target boot", "") time.sleep(20) - # run_command_with_timeout(f"{GP.hdc_head} wait", 20) - # assert check_shell(f"target boot -bootloader", "") - # run_command_with_timeout(f"{GP.hdc_head} wait", 20) - # assert check_shell(f"target boot -recovery", "") """ hdc smode [-r] diff --git a/test/unittest/common/include/define_ut.h b/test/unittest/common/include/define_ut.h index 23328659..86189e16 100644 --- a/test/unittest/common/include/define_ut.h +++ b/test/unittest/common/include/define_ut.h @@ -14,6 +14,7 @@ */ #ifndef HDC_DEFINE_TEST_H +#define HDC_DEFINE_TEST_H #include #include #include "define_plus.h" -- Gitee From ce0d075cf8f88ba4564194307b935efaa13c069b Mon Sep 17 00:00:00 2001 From: luciferWei Date: Tue, 10 Jun 2025 18:55:46 +0800 Subject: [PATCH 02/10] =?UTF-8?q?Feat=EF=BC=9A=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=20=20\nSigned-off-by:=20LuciferWei=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/base.cpp | 2 +- src/common/define_enum.h | 4 ++-- src/host/server.cpp | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/base.cpp b/src/common/base.cpp index 3c6c16b2..da1aee15 100644 --- a/src/common/base.cpp +++ b/src/common/base.cpp @@ -2978,7 +2978,7 @@ void CloseOpenFd(void) ThreadProcessCmdLogs(); } std::this_thread::sleep_for(std::chrono::seconds(1)); - if (false == Hdc::ServerCmdLog::GetInstance().GetRunningStatus()) { + if (Hdc::ServerCmdLog::GetInstance().GetRunningStatus() == false) { break; } } diff --git a/src/common/define_enum.h b/src/common/define_enum.h index 93735756..5ce4d155 100644 --- a/src/common/define_enum.h +++ b/src/common/define_enum.h @@ -23,7 +23,7 @@ enum MessageLevel { }; enum ConnType { CONN_USB = 0, CONN_TCP, CONN_SERIAL, CONN_BT, CONN_UNKNOWN }; -const std::string ConTypeDetail[] = { "USB", "TCP", "UART", "BT", "UNKNOWN" }; +const std::string conTypeDetail[] = { "USB", "TCP", "UART", "BT", "UNKNOWN" }; #ifdef HDC_SUPPORT_UART enum UartTimeConst { @@ -51,7 +51,7 @@ enum UartSetSerialNStop { }; #endif enum ConnStatus { STATUS_UNKNOW = 0, STATUS_READY, STATUS_CONNECTED, STATUS_OFFLINE, STATUS_UNAUTH }; -const std::string ConStatusDetail[] = { "Unknown", "Ready", "Connected", "Offline", "Unauthorized" }; +const std::string conStatusDetail[] = { "Unknown", "Ready", "Connected", "Offline", "Unauthorized" }; enum AuthVerifyType { RSA_ENCRYPT = 0, RSA_3072_SHA512 = 1, UNKNOWN = 100 }; diff --git a/src/host/server.cpp b/src/host/server.cpp index 7c203de0..499944d5 100644 --- a/src/host/server.cpp +++ b/src/host/server.cpp @@ -232,17 +232,17 @@ void HdcServer::ClearMapDaemonInfo() void HdcServer::BuildDaemonVisableLine(HDaemonInfo hdi, bool fullDisplay, string &out) { if (fullDisplay) { - string sConn = ConTypeDetail[CONN_UNKNOWN]; + string sConn = conTypeDetail[CONN_UNKNOWN]; if (hdi->connType < CONN_UNKNOWN) { - sConn = ConTypeDetail[hdi->connType]; + sConn = conTypeDetail[hdi->connType]; } - string sStatus = ConStatusDetail[STATUS_UNKNOW]; + string sStatus = conStatusDetail[STATUS_UNKNOW]; if (hdi->connStatus < STATUS_UNAUTH) { if (hdi->connStatus == STATUS_CONNECTED && hdi->daemonAuthStatus == DAEOMN_UNAUTHORIZED) { - sStatus = ConStatusDetail[STATUS_UNAUTH]; + sStatus = conStatusDetail[STATUS_UNAUTH]; } else { - sStatus = ConStatusDetail[hdi->connStatus]; + sStatus = conStatusDetail[hdi->connStatus]; } } -- Gitee From 228e7041691f088ef14e29e3bfe8c2aea864ab65 Mon Sep 17 00:00:00 2001 From: luciferWei Date: Wed, 11 Jun 2025 10:41:09 +0800 Subject: [PATCH 03/10] =?UTF-8?q?Feat=EF=BC=9A=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=20=20\nSigned-off-by:=20LuciferWei=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/define_enum.h | 4 ++-- src/host/server.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/define_enum.h b/src/common/define_enum.h index 5ce4d155..d768a590 100644 --- a/src/common/define_enum.h +++ b/src/common/define_enum.h @@ -23,7 +23,7 @@ enum MessageLevel { }; enum ConnType { CONN_USB = 0, CONN_TCP, CONN_SERIAL, CONN_BT, CONN_UNKNOWN }; -const std::string conTypeDetail[] = { "USB", "TCP", "UART", "BT", "UNKNOWN" }; +const std::string CON_TYPE_DETAIL[] = { "USB", "TCP", "UART", "BT", "UNKNOWN" }; #ifdef HDC_SUPPORT_UART enum UartTimeConst { @@ -51,7 +51,7 @@ enum UartSetSerialNStop { }; #endif enum ConnStatus { STATUS_UNKNOW = 0, STATUS_READY, STATUS_CONNECTED, STATUS_OFFLINE, STATUS_UNAUTH }; -const std::string conStatusDetail[] = { "Unknown", "Ready", "Connected", "Offline", "Unauthorized" }; +const std::string CON_STATUS_DETAIL[] = { "Unknown", "Ready", "Connected", "Offline", "Unauthorized" }; enum AuthVerifyType { RSA_ENCRYPT = 0, RSA_3072_SHA512 = 1, UNKNOWN = 100 }; diff --git a/src/host/server.cpp b/src/host/server.cpp index 499944d5..cef28f44 100644 --- a/src/host/server.cpp +++ b/src/host/server.cpp @@ -232,17 +232,17 @@ void HdcServer::ClearMapDaemonInfo() void HdcServer::BuildDaemonVisableLine(HDaemonInfo hdi, bool fullDisplay, string &out) { if (fullDisplay) { - string sConn = conTypeDetail[CONN_UNKNOWN]; + string sConn = CON_TYPE_DETAIL[CONN_UNKNOWN]; if (hdi->connType < CONN_UNKNOWN) { - sConn = conTypeDetail[hdi->connType]; + sConn = CON_TYPE_DETAIL[hdi->connType]; } - string sStatus = conStatusDetail[STATUS_UNKNOW]; + string sStatus = CON_STATUS_DETAIL[STATUS_UNKNOW]; if (hdi->connStatus < STATUS_UNAUTH) { if (hdi->connStatus == STATUS_CONNECTED && hdi->daemonAuthStatus == DAEOMN_UNAUTHORIZED) { - sStatus = conStatusDetail[STATUS_UNAUTH]; + sStatus = CON_STATUS_DETAIL[STATUS_UNAUTH]; } else { - sStatus = conStatusDetail[hdi->connStatus]; + sStatus = CON_STATUS_DETAIL[hdi->connStatus]; } } -- Gitee From 2f8db2715f0f0d1fca6101ffe9495c5a14325a27 Mon Sep 17 00:00:00 2001 From: luciferWei Date: Wed, 11 Jun 2025 17:19:53 +0800 Subject: [PATCH 04/10] =?UTF-8?q?Feat=EF=BC=9A=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=20=20\nSigned-off-by:=20LuciferWei=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../testModule/test_hdc_return_value_check.py | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/test/scripts/testModule/test_hdc_return_value_check.py b/test/scripts/testModule/test_hdc_return_value_check.py index e68c9c0e..0e4dc485 100644 --- a/test/scripts/testModule/test_hdc_return_value_check.py +++ b/test/scripts/testModule/test_hdc_return_value_check.py @@ -47,20 +47,10 @@ class TestHdcReturnValue: return size == first_line_size + content_size - @staticmethod - def compare_line_with_result(line, result_lines, index): - while len(result_lines[index]) == 0: - index += 1 - if index >= len(result_lines): - return True - if line != result_lines[index]: - logger.warning(f"line:{line}, result line:{result_lines[index]}") - return False - return True - """ hdc help命令的输出与hdc.log文件内容非空行逐行比较,全部相等则成功 """ + @pytest.mark.L0 def test_hdc_help(self): result = get_shell_result(f"help") @@ -70,9 +60,16 @@ class TestHdcReturnValue: with open(help_file, 'r') as file: for line in file.readlines(): line = line.replace("\n", "") + while len(result_lines[index]) == 0: + index = index + 1 + if index >= len(result_lines): + return if line: - if (False is self.compare_line_with_result(line, result_lines, index)): + if line != result_lines[index]: + logger.warning(f"line:{line}, result line:{result_lines[index]}") assert False + return + index = index + 1 return """ -- Gitee From a149e84bd845957e267496da0a153ae2307d4a73 Mon Sep 17 00:00:00 2001 From: luciferWei Date: Thu, 12 Jun 2025 11:26:33 +0800 Subject: [PATCH 05/10] =?UTF-8?q?Feat=EF=BC=9A=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=20=20\nSigned-off-by:=20LuciferWei=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/base.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/common/base.cpp b/src/common/base.cpp index da1aee15..90056d8a 100644 --- a/src/common/base.cpp +++ b/src/common/base.cpp @@ -2967,7 +2967,7 @@ void CloseOpenFd(void) void ThreadCmdStrAndCmdLogs() { - while (true) { + while (Hdc::ServerCmdLog::GetInstance().GetRunningStatus()) { size_t cmdLogCount = 0; cmdLogCount = Hdc::ServerCmdLog::GetInstance().CmdLogStrSize(); auto lastFlushTime = Hdc::ServerCmdLog::GetInstance().GetLastFlushTime(); @@ -2978,9 +2978,6 @@ void CloseOpenFd(void) ThreadProcessCmdLogs(); } std::this_thread::sleep_for(std::chrono::seconds(1)); - if (Hdc::ServerCmdLog::GetInstance().GetRunningStatus() == false) { - break; - } } } -- Gitee From cb6ecf796e88a8cda622c79901310c43999918d8 Mon Sep 17 00:00:00 2001 From: luciferWei Date: Fri, 13 Jun 2025 09:32:48 +0800 Subject: [PATCH 06/10] =?UTF-8?q?Feat=EF=BC=9A=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=20=20\nSigned-off-by:=20LuciferWei=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/session.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/session.cpp b/src/common/session.cpp index f99fd8b6..69fe1b54 100755 --- a/src/common/session.cpp +++ b/src/common/session.cpp @@ -729,7 +729,12 @@ HSession HdcSessionBase::VoteReset(const uint32_t sessionId) bool needReset = true; if (serverOrDaemon) { uv_rwlock_wrlock(&lockMapSession); - hRet = mapSession[sessionId]; + hRet = mapSession.find(sessionId); + if (hRet == mapSession.end()) { + uv_rwlock_wrunlock(&lockMapSession); + WRITE_LOG(LOG_ERROR, "VoteReset sessionId:%u not found", sessionId); + return nullptr; + } hRet->voteReset = true; for (auto &kv : mapSession) { if (sessionId == kv.first) { @@ -1017,7 +1022,8 @@ int HdcSessionBase::OnRead(HSession hSession, uint8_t *bufPtr, const int bufLen) } // Returns <0 error;> 0 receives the number of bytes; 0 untreated -int HdcSessionBase::FetchIOBuf(HSession hSession, uint8_t *ioBuf, int read) +int HdcSessionBase:: + (HSession hSession, uint8_t *ioBuf, int read) { HdcSessionBase *ptrConnect = (HdcSessionBase *)hSession->classInstance; int indexBuf = 0; -- Gitee From f799023f1b1ba2ad7b380c7b32217b5cb12b78a1 Mon Sep 17 00:00:00 2001 From: luciferWei Date: Fri, 13 Jun 2025 09:51:33 +0800 Subject: [PATCH 07/10] =?UTF-8?q?Feat=EF=BC=9A=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=20=20\nSigned-off-by:=20LuciferWei=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/session.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/session.cpp b/src/common/session.cpp index 69fe1b54..b027288d 100755 --- a/src/common/session.cpp +++ b/src/common/session.cpp @@ -729,8 +729,10 @@ HSession HdcSessionBase::VoteReset(const uint32_t sessionId) bool needReset = true; if (serverOrDaemon) { uv_rwlock_wrlock(&lockMapSession); - hRet = mapSession.find(sessionId); - if (hRet == mapSession.end()) { + auto it = mapSession.find(sessionId); + if (it != mapSession.end()) { + hRet = it->second; + } else { uv_rwlock_wrunlock(&lockMapSession); WRITE_LOG(LOG_ERROR, "VoteReset sessionId:%u not found", sessionId); return nullptr; -- Gitee From 96a968088bcc0c052d0869d65076238da24b3728 Mon Sep 17 00:00:00 2001 From: luciferWei Date: Fri, 13 Jun 2025 10:43:03 +0800 Subject: [PATCH 08/10] =?UTF-8?q?Feat=EF=BC=9A=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=20=20\nSigned-off-by:=20LuciferWei=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/session.cpp b/src/common/session.cpp index b027288d..d0ffe34a 100755 --- a/src/common/session.cpp +++ b/src/common/session.cpp @@ -734,7 +734,7 @@ HSession HdcSessionBase::VoteReset(const uint32_t sessionId) hRet = it->second; } else { uv_rwlock_wrunlock(&lockMapSession); - WRITE_LOG(LOG_ERROR, "VoteReset sessionId:%u not found", sessionId); + WRITE_LOG(LOG_WARN, "VoteReset sessionId:%u not found", sessionId); return nullptr; } hRet->voteReset = true; -- Gitee From 3bac9baa203fd97f719f982aec444b169cbb13ae Mon Sep 17 00:00:00 2001 From: luciferWei Date: Fri, 13 Jun 2025 11:14:36 +0800 Subject: [PATCH 09/10] =?UTF-8?q?Feat=EF=BC=9A=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=20=20\nSigned-off-by:=20LuciferWei=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/session.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/session.cpp b/src/common/session.cpp index d0ffe34a..87260ecb 100755 --- a/src/common/session.cpp +++ b/src/common/session.cpp @@ -1024,8 +1024,7 @@ int HdcSessionBase::OnRead(HSession hSession, uint8_t *bufPtr, const int bufLen) } // Returns <0 error;> 0 receives the number of bytes; 0 untreated -int HdcSessionBase:: - (HSession hSession, uint8_t *ioBuf, int read) +int HdcSessionBase::FetchIOBuf(HSession hSession, uint8_t *ioBuf, int read) { HdcSessionBase *ptrConnect = (HdcSessionBase *)hSession->classInstance; int indexBuf = 0; -- Gitee From d0ad94084da5403cc0767b43e3fb017f5e1ef54b Mon Sep 17 00:00:00 2001 From: luciferWei Date: Fri, 13 Jun 2025 15:03:48 +0800 Subject: [PATCH 10/10] =?UTF-8?q?Feat=EF=BC=9A=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=20=20\nSigned-off-by:=20LuciferWei=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/session.cpp b/src/common/session.cpp index 87260ecb..4d1318e7 100755 --- a/src/common/session.cpp +++ b/src/common/session.cpp @@ -731,7 +731,7 @@ HSession HdcSessionBase::VoteReset(const uint32_t sessionId) uv_rwlock_wrlock(&lockMapSession); auto it = mapSession.find(sessionId); if (it != mapSession.end()) { - hRet = it->second; + hRet = it->second; } else { uv_rwlock_wrunlock(&lockMapSession); WRITE_LOG(LOG_WARN, "VoteReset sessionId:%u not found", sessionId); -- Gitee