修复了MQTT曾经连上,但中途长时间断开,导致消息队列一直增加爆内存,进而导致死机的问题

This commit is contained in:
Your Name
2025-04-21 21:17:34 +08:00
parent f3b7477550
commit 36861fadff
4 changed files with 886 additions and 867 deletions

View File

@@ -1519,7 +1519,7 @@ document.getElementById("submit-ota-link").disabled = true;
//return;
var fileInput = document.getElementById("ota_file");
if (fileInput.files.length === 0) {
alert("请选择要上传的 OTA 文件");
Toast("请选择要上传的 OTA 文件");
return;
}
clearTimeout(powerTimerId);

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,8 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "mico.h"
#include"http_server/web_log.h"
@@ -36,6 +38,9 @@ char* GetLogRecord()
tmp += strlen(tmp);
if (!log_record.logs[i%LOG_NUM]) continue;
sprintf(tmp, "%s\n", log_record.logs[i%LOG_NUM]);
if(i == log_record.idx){
sprintf(tmp, "FreeMem %d bytes\n", MicoGetMemoryInfo()->free_memory);
}
}
return log_record_str;
}

View File

@@ -443,7 +443,7 @@ void ProcessHaCmd(char *cmd) {
OSStatus UserMqttSendTopic(char *topic, char *arg, char retained) {
OSStatus err = kUnknownErr;
p_mqtt_send_msg_t p_send_msg = NULL;
if(mqtt_msg_send_queue == NULL){
if(mqtt_msg_send_queue == NULL|| !isconnect){
return err;
}