unbound: fix typo in logger. create a pipe early in dnsbl_module.py (#6340)

This commit is contained in:
kulikov-a 2023-02-20 12:13:46 +03:00 committed by GitHub
parent 674ddc0d21
commit 5d77a44ccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -188,7 +188,7 @@ class DNSReader:
r_count = 0
pipe_ready = False
# give dnsbl_module.py some time to create a pipe
while r_count < 3 and not pipe_ready:
while not pipe_ready:
try:
# open() will block until a query has been pushed down the fifo
self.fd = open(self.target_pipe, 'r')
@ -196,8 +196,8 @@ class DNSReader:
except InterruptedError:
self.close_logger()
except OSError:
r_count =+ 1
if r_count == 3:
r_count += 1
if r_count > 10:
syslog.syslog(syslog.LOG_ERR, "Unable to open pipe. This is likely because Unbound isn't running.")
sys.exit(1)
time.sleep(1)

View File

@ -65,9 +65,9 @@ class ModuleContext:
self.lock = Lock()
self.pipe_buffer = deque(maxlen=100000) # buffer to hold qdata as long as a backend is not present
self.update_dnsbl(self.log_update_time)
if self.stats_enabled:
self.create_pipe_rdv()
self.update_dnsbl(self.log_update_time)
def dnsbl_exists(self):
return os.path.isfile(self.dnsbl_path) and os.path.getsize(self.dnsbl_path) > 0