Catch bad DNS queries and reduce exception logging
This commit is contained in:
@@ -61,7 +61,7 @@ final class Query
|
||||
} catch (\Exception $e) {
|
||||
Log::error(sprintf('%s:! Unpack failed: Buffer: [%s] (%d), RXPTR [%d]',self::LOGKEY,hex_dump($this->buf),strlen($this->buf),$rx_ptr));
|
||||
|
||||
return;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$rx_ptr += 4;
|
||||
@@ -82,9 +82,8 @@ final class Query
|
||||
$rx_ptr += $this->additional->length;
|
||||
}
|
||||
|
||||
if (strlen($this->buf) !== $rx_ptr) {
|
||||
dd(['query remaining'=>strlen($this->buf)-$rx_ptr,'hex'=>hex_dump(substr($this->buf,$rx_ptr))]);
|
||||
}
|
||||
if (strlen($this->buf) !== $rx_ptr)
|
||||
throw new \Exception(sprintf('! DNS Buffer still has [%d]: %s',strlen($this->buf)-$rx_ptr,hex_dump(substr($this->buf,$rx_ptr))));
|
||||
}
|
||||
|
||||
public function __get($key)
|
||||
|
Reference in New Issue
Block a user