From de36a81893f613e79e8bc802a0ca8e630efb1ee8 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Thu, 21 Dec 2023 19:39:19 +0800 Subject: [PATCH] bugfixed: parse ip and port use parseAddress instead of splitEx --- HISTORY | 3 +++ tracker/tracker_service.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index d949ed9..aa33420 100644 --- a/HISTORY +++ b/HISTORY @@ -1,4 +1,7 @@ +Version 6.12.0 2023-12-21 + * bugfixed: parse ip and port use parseAddress instead of splitEx + Version 6.11.0 2023-12-10 * support IPv6, config item: address_family in tracker.conf and storage.conf use libfastcommon V1.71 and libserverframe 1.2.1 diff --git a/tracker/tracker_service.c b/tracker/tracker_service.c index 9ce5a35..0a541d5 100644 --- a/tracker/tracker_service.c +++ b/tracker/tracker_service.c @@ -663,7 +663,7 @@ static int tracker_deal_notify_next_leader(struct fast_task_info *pTask) *(pTask->recv.ptr->data + pTask->recv.ptr->length) = '\0'; pIpAndPort = pTask->recv.ptr->data + sizeof(TrackerHeader); - if (splitEx(pIpAndPort, ':', ipAndPort, 2) != 2) + if (parseAddress(pIpAndPort, ipAndPort) != 2) { logError("file: "__FILE__", line: %d, " \ "client ip: %s, invalid ip and port: %s", \ @@ -729,7 +729,7 @@ static int tracker_deal_commit_next_leader(struct fast_task_info *pTask) *(pTask->recv.ptr->data + pTask->recv.ptr->length) = '\0'; pIpAndPort = pTask->recv.ptr->data + sizeof(TrackerHeader); - if (splitEx(pIpAndPort, ':', ipAndPort, 2) != 2) + if (parseAddress(pIpAndPort, ipAndPort) != 2) { logError("file: "__FILE__", line: %d, " \ "client ip: %s, invalid ip and port: %s", \