浏览代码

[Bug gix][Modularization][Module_OcppBackend]

2020.10.21 / Folus Wen

Actions:
1. EVSE/Modularization/ocppfiles/MessageHandler.c URL parsing bug fix for without root directory flag.

Files:
1. As follow commit history

Image version: D0.00.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 4 年之前
父节点
当前提交
7c78d0843d
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      EVSE/Modularization/ocppfiles/MessageHandler.c

+ 11 - 2
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -15194,7 +15194,12 @@ int GetOcppServerURL()
 		{
 			sprintf(OcppProtocol, "%s", url.scheme);
 			sprintf(OcppHost, "%s", url.host);
-			sprintf(OcppTempPath, "%s", url.path);
+
+			if(url.path == NULL)
+				OcppTempPath[0] = '\0';
+			else
+				sprintf(OcppTempPath, "%s", url.path);
+
 			if(url.port == 0)
 			{
 				if(strcmp(OcppProtocol, "wss") == 0)
@@ -15219,7 +15224,11 @@ int GetOcppServerURL()
 		{
 			sprintf(OcppProtocol, "%s", url.scheme);
 			sprintf(OcppHost, "%s", url.host);
-			sprintf(OcppTempPath, "%s", url.path);
+			if(url.path == NULL)
+				OcppTempPath[0] = '\0';
+			else
+				sprintf(OcppTempPath, "%s", url.path);
+
 			if(url.port == 0)
 			{
 				if(strcmp(OcppProtocol, "wss") == 0)