mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 19:32:19 +01:00
OTA: Close and clean up client when setsockopt fails (#8865)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1ec57a74b5
commit
69da17742f
@@ -111,6 +111,8 @@ void ESPHomeOTAComponent::handle_() {
|
|||||||
int err = client_->setsockopt(IPPROTO_TCP, TCP_NODELAY, &enable, sizeof(int));
|
int err = client_->setsockopt(IPPROTO_TCP, TCP_NODELAY, &enable, sizeof(int));
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
ESP_LOGW(TAG, "Socket could not enable TCP nodelay, errno %d", errno);
|
ESP_LOGW(TAG, "Socket could not enable TCP nodelay, errno %d", errno);
|
||||||
|
client_->close();
|
||||||
|
client_ = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user