Skip to content

Commit fc93c5c

Browse files
committed
ClientContext:_write_some: release buffer once data really accepted for sending
may fix esp8266#1872
1 parent 4bafbe5 commit fc93c5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/ESP8266WiFi/src/include/ClientContext.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ class ClientContext
447447
}
448448
err_t err = tcp_write(_pcb, buf, next_chunk, TCP_WRITE_FLAG_COPY);
449449
DEBUGV(":wrc %d %d %d\r\n", next_chunk, will_send, (int) err);
450-
_datasource->release_buffer(buf, next_chunk);
451450
if (err == ERR_OK) {
451+
_datasource->release_buffer(buf, next_chunk);
452452
_written += next_chunk;
453453
need_output = true;
454454
} else {

0 commit comments

Comments
 (0)