watchd: remove non-printable chars from logged response

This commit is contained in:
rofl0r
2019-01-07 02:54:33 +00:00
parent c8d93751fe
commit 497f8b2050

View File

@@ -90,7 +90,8 @@ class WorkerJob():
self.total_duration += int(duration*1000)
cstats = "" if match == 'unknown' else ' c: %s;'%match
torstats = "" if len(config.torhosts)==1 else ' tor: %s;'%tor
_log('%s://%s;%s d: %.2f sec(s);%s; srv: %s; recv: %s' % (proto, self.proxy, cstats, duration, torstats, srv, recv), 'xxxxx')
recvstats = "".join([x if x in string.printable and ord(x) > 32 else '.' for x in recv])
_log('%s://%s;%s d: %.2f sec(s);%s srv: %s; recv: %s' % (proto, self.proxy, cstats, duration, torstats, srv, recvstats), 'xxxxx')
except KeyboardInterrupt as e:
raise e
except: