1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-28 16:12:24 +01:00
This commit is contained in:
J. Nick Koston
2025-09-26 21:54:58 -05:00
parent cc4c059429
commit e7b9f17bbe
2 changed files with 7 additions and 2 deletions

View File

@@ -171,7 +171,7 @@ void ESPHomeOTAComponent::handle_handshake_() {
if (read == -1) { if (read == -1) {
this->log_socket_error_(LOG_STR("reading magic bytes")); this->log_socket_error_(LOG_STR("reading magic bytes"));
} else { } else {
ESP_LOGW(TAG, "Remote closed during handshake"); this->log_remote_closed_(LOG_STR("handshake"));
} }
this->cleanup_connection_(); this->cleanup_connection_();
return; return;
@@ -247,7 +247,7 @@ void ESPHomeOTAComponent::handle_handshake_() {
if (read == -1) { if (read == -1) {
this->log_socket_error_(LOG_STR("reading features")); this->log_socket_error_(LOG_STR("reading features"));
} else { } else {
ESP_LOGW(TAG, "Remote closed during feature read"); this->log_remote_closed_(LOG_STR("feature read"));
} }
this->cleanup_connection_(); this->cleanup_connection_();
return; return;
@@ -590,6 +590,10 @@ void ESPHomeOTAComponent::log_start_(const LogString *phase) {
ESP_LOGD(TAG, "Starting %s from %s", LOG_STR_ARG(phase), this->client_->getpeername().c_str()); ESP_LOGD(TAG, "Starting %s from %s", LOG_STR_ARG(phase), this->client_->getpeername().c_str());
} }
void ESPHomeOTAComponent::log_remote_closed_(const LogString *during) {
ESP_LOGW(TAG, "Remote closed during %s", LOG_STR_ARG(during));
}
void ESPHomeOTAComponent::cleanup_connection_() { void ESPHomeOTAComponent::cleanup_connection_() {
this->client_->close(); this->client_->close();
this->client_ = nullptr; this->client_ = nullptr;

View File

@@ -49,6 +49,7 @@ class ESPHomeOTAComponent : public ota::OTAComponent {
void log_socket_error_(const LogString *msg); void log_socket_error_(const LogString *msg);
void log_read_error_(const LogString *what); void log_read_error_(const LogString *what);
void log_start_(const LogString *phase); void log_start_(const LogString *phase);
void log_remote_closed_(const LogString *during);
void cleanup_connection_(); void cleanup_connection_();
void yield_and_feed_watchdog_(); void yield_and_feed_watchdog_();