1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-29 16:42:19 +01:00
This commit is contained in:
J. Nick Koston
2025-09-27 13:20:58 -05:00
parent e5908389aa
commit d66fd678c2
2 changed files with 2 additions and 7 deletions

View File

@@ -83,12 +83,9 @@ void DNSServer::stop() {
void DNSServer::process_next_request() { void DNSServer::process_next_request() {
// Process one request if socket is valid and data is available // Process one request if socket is valid and data is available
if (this->socket_ != nullptr && this->socket_->ready()) { if (this->socket_ == nullptr || !this->socket_->ready()) {
this->process_dns_request(); return;
} }
}
void DNSServer::process_dns_request() {
struct sockaddr_in client_addr; struct sockaddr_in client_addr;
socklen_t client_addr_len = sizeof(client_addr); socklen_t client_addr_len = sizeof(client_addr);

View File

@@ -17,8 +17,6 @@ class DNSServer {
protected: protected:
static constexpr size_t DNS_BUFFER_SIZE = 192; static constexpr size_t DNS_BUFFER_SIZE = 192;
void process_dns_request();
std::unique_ptr<socket::Socket> socket_{nullptr}; std::unique_ptr<socket::Socket> socket_{nullptr};
network::IPAddress server_ip_; network::IPAddress server_ip_;
uint8_t buffer_[DNS_BUFFER_SIZE]; uint8_t buffer_[DNS_BUFFER_SIZE];