fix(mux): 修复MUX半帧丢失与发送路径静默失败
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user