Skip to content

Commit ff06df8

Browse files
author
windows11
committed
修复告警信息和URL特殊字符冲突的问题
1 parent 9ee1516 commit ff06df8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/src/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,10 @@ void CMain::WatchdogMessage(int ClientNetID, double load_1, double load_5, doubl
325325
char standardTime[32]= { 0 };
326326
strftime(standardTime, sizeof(standardTime), "%Y-%m-%d %H:%M:%S",localtime(&currentStamp));
327327

328-
//url encode
328+
//url encode, Rules conflict with url special characters,eg:&, del rules, by https://cpp.la, 2023-10-09
329329
char encodeBuffer[2048] = { 0 };
330-
sprintf(encodeBuffer, " \n\n【告警名称】 %s \n\n告警规则】 %s \n\n告警时间】 %s \n\n ---------------- \n\n【用户名】 %s \n\n【节点名】 %s \n\n【虚拟化】 %s \n\n【主机名】 %s \n\n【位 置】 %s",
330+
sprintf(encodeBuffer, "【告警名称】 %s \n\n【告警时间】 %s \n\n【用户名】 %s \n\n【节点名】 %s \n\n【虚拟化】 %s \n\n【主机名】 %s \n\n【位 置】 %s",
331331
Watchdog(ID)->m_aName,
332-
Watchdog(ID)->m_aRule,
333332
standardTime,
334333
Client(ClientID)->m_aUsername,
335334
Client(ClientID)->m_aName,

0 commit comments

Comments
 (0)