mirror of
https://github.com/esphome/esphome.git
synced 2026-09-16 01:28:39 +00:00
[api] Inline check_socket_write_err_ in drain_overflow (removed from header)
This commit is contained in:
@@ -103,7 +103,8 @@ const LogString *api_error_to_logstr(APIError err) {
|
||||
APIError APIFrameHelper::drain_overflow_and_handle_errors_() {
|
||||
if (this->overflow_buf_.try_drain(this->socket_.get()) == -1) {
|
||||
int err = errno;
|
||||
if (this->check_socket_write_err_(err) != APIError::WOULD_BLOCK) {
|
||||
if (err != EWOULDBLOCK && err != EAGAIN) {
|
||||
this->state_ = State::FAILED;
|
||||
HELPER_LOG("Socket write failed with errno %d", err);
|
||||
return APIError::SOCKET_WRITE_FAILED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user