mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
Services/Unbound - choose a delimiter (|) and translate empty values to empty strings. should fix https://github.com/opnsense/core/issues/6456
Although I couldn't reproduce the exact same issue, if some values are empty ('') and some are null (None), weird things might happen. This commit makes sure there is a field delimiter, which logically shouldn't exist in the datastream itself and prevent null values being presented as "None".
This commit is contained in:
parent
a0c8016b2f
commit
0a6a3a7715
@ -136,7 +136,7 @@ class DNSReader:
|
||||
if r == '':
|
||||
return False
|
||||
|
||||
q = tuple(r.strip("\n").split())
|
||||
q = tuple(r.strip("\n").split('|'))
|
||||
self.buffer.append(q)
|
||||
|
||||
self.update_clients.add(q[2])
|
||||
|
||||
@ -222,7 +222,7 @@ class Logger:
|
||||
try:
|
||||
while len(self._pipe_buffer) > 0:
|
||||
l = self._pipe_buffer.popleft()
|
||||
res = "{} {} {} {} {} {} {} {} {} {} {} {} {}\n".format(*l)
|
||||
res = "{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}\n".format(*['' if x is None else x for x in l])
|
||||
os.write(self._pipe_fd, res.encode())
|
||||
except (BrokenPipeError, BlockingIOError) as e:
|
||||
if e.__class__.__name__ == 'BrokenPipeError':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user