mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-24 06:38:29 +02:00
Fix socket connection closed not detected (#2587)
This commit is contained in:
@@ -320,8 +320,7 @@ class LWIPRawImpl : public Socket {
|
||||
return -1;
|
||||
}
|
||||
if (rx_closed_ && rx_buf_ == nullptr) {
|
||||
errno = ECONNRESET;
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
if (len == 0) {
|
||||
return 0;
|
||||
@@ -366,6 +365,11 @@ class LWIPRawImpl : public Socket {
|
||||
read += copysize;
|
||||
}
|
||||
|
||||
if (read == 0) {
|
||||
errno = EWOULDBLOCK;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return read;
|
||||
}
|
||||
ssize_t readv(const struct iovec *iov, int iovcnt) override {
|
||||
|
||||
Reference in New Issue
Block a user