mirror of
https://github.com/esphome/esphome.git
synced 2025-10-01 01:22:20 +01: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