mirror of
https://github.com/esphome/esphome.git
synced 2025-09-29 08:32:26 +01:00
Merge branch 'make_captive_portal_captive' into integration
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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];
|
||||
|
Reference in New Issue
Block a user