mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
ClientContext:_write_some: release buffer once data really accepted for sending (#4265)
may fix #1872
This commit is contained in:
parent
9ba8f77678
commit
199fe0f16d
@ -447,11 +447,13 @@ protected:
|
|||||||
}
|
}
|
||||||
err_t err = tcp_write(_pcb, buf, next_chunk, TCP_WRITE_FLAG_COPY);
|
err_t err = tcp_write(_pcb, buf, next_chunk, TCP_WRITE_FLAG_COPY);
|
||||||
DEBUGV(":wrc %d %d %d\r\n", next_chunk, will_send, (int) err);
|
DEBUGV(":wrc %d %d %d\r\n", next_chunk, will_send, (int) err);
|
||||||
_datasource->release_buffer(buf, next_chunk);
|
|
||||||
if (err == ERR_OK) {
|
if (err == ERR_OK) {
|
||||||
|
_datasource->release_buffer(buf, next_chunk);
|
||||||
_written += next_chunk;
|
_written += next_chunk;
|
||||||
need_output = true;
|
need_output = true;
|
||||||
} else {
|
} else {
|
||||||
|
// ERR_MEM(-1) is a valid error meaning
|
||||||
|
// "come back later". It leaves state() opened
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
will_send -= next_chunk;
|
will_send -= next_chunk;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user