1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-29 16:42:19 +01:00

Merge branch 'integration' into memory_api

This commit is contained in:
J. Nick Koston
2025-09-27 13:22:15 -05:00
2 changed files with 3 additions and 8 deletions

View File

@@ -83,12 +83,9 @@ void DNSServer::stop() {
void DNSServer::process_next_request() {
// Process one request if socket is valid and data is available
if (this->socket_ != nullptr && this->socket_->ready()) {
this->process_dns_request();
if (this->socket_ == nullptr || !this->socket_->ready()) {
return;
}
}
void DNSServer::process_dns_request() {
struct sockaddr_in client_addr;
socklen_t client_addr_len = sizeof(client_addr);
@@ -110,7 +107,7 @@ void DNSServer::process_dns_request() {
ESP_LOGVV(TAG, "Received %d bytes from %s:%d", len, inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
if (len < sizeof(DNSHeader) + 1) {
if (len < static_cast<ssize_t>(sizeof(DNSHeader) + 1)) {
ESP_LOGV(TAG, "Request too short: %d", len);
return;
}

View File

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