fix(mux): 修复MUX半帧丢失与发送路径静默失败

This commit is contained in:
2026-04-18 18:48:38 +08:00
parent a0b27d34a0
commit 495fbe4298
4 changed files with 225 additions and 78 deletions
+9
View File
@@ -239,14 +239,23 @@ int tcp_client_send(uint8_t instance, const uint8_t *data, uint16_t len)
return -1;
}
if (tcp_sndbuf(ctx->pcb) < len) {
ctx->status.errors++;
return 0;
}
err = tcp_write(ctx->pcb, data, len, TCP_WRITE_FLAG_COPY);
if (err == ERR_MEM) {
ctx->status.errors++;
return 0;
}
if (err != ERR_OK) {
ctx->status.errors++;
return -1;
}
err = tcp_output(ctx->pcb);
if (err == ERR_MEM) {
ctx->status.errors++;
return 0;
}
if (err != ERR_OK) {
ctx->status.errors++;
return -1;