fix(mux): 修复MUX半帧丢失与发送路径静默失败
This commit is contained in:
@@ -228,15 +228,24 @@ int tcp_server_send(uint8_t instance, const uint8_t *data, uint16_t len)
|
||||
return -1;
|
||||
}
|
||||
if (tcp_sndbuf(ctx->client_pcb) < len) {
|
||||
ctx->status.errors++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
err = tcp_write(ctx->client_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->client_pcb);
|
||||
if (err == ERR_MEM) {
|
||||
ctx->status.errors++;
|
||||
return 0;
|
||||
}
|
||||
if (err != ERR_OK) {
|
||||
ctx->status.errors++;
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user