mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
[socket] Hold lwip lock for entire write() operation
Same pattern as writev — write() calls internal_write_() then internal_output_(), each acquiring the lock separately. Hold the lock at the outer scope so inner calls just bump the recursion counter.
This commit is contained in:
@@ -616,6 +616,7 @@ int LWIPRawImpl::internal_output_() {
|
||||
}
|
||||
|
||||
ssize_t LWIPRawImpl::write(const void *buf, size_t len) {
|
||||
LWIP_LOCK(); // Hold for write + optional output
|
||||
ssize_t written = this->internal_write_(buf, len);
|
||||
if (written == -1)
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user