mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-01 07:49:10 +00:00
Don't add stuff to our internal log buffer if noapi is on.
This commit is contained in:
parent
11896d2118
commit
e9de11f0e3
@ -206,14 +206,15 @@ class Pathod(tcp.TCPServer):
|
|||||||
h.finish()
|
h.finish()
|
||||||
|
|
||||||
def add_log(self, d):
|
def add_log(self, d):
|
||||||
lock = threading.Lock()
|
if not self.noapi:
|
||||||
with lock:
|
lock = threading.Lock()
|
||||||
d["id"] = self.logid
|
with lock:
|
||||||
self.log.insert(0, d)
|
d["id"] = self.logid
|
||||||
if len(self.log) > self.LOGBUF:
|
self.log.insert(0, d)
|
||||||
self.log.pop()
|
if len(self.log) > self.LOGBUF:
|
||||||
self.logid += 1
|
self.log.pop()
|
||||||
return d["id"]
|
self.logid += 1
|
||||||
|
return d["id"]
|
||||||
|
|
||||||
def clear_log(self):
|
def clear_log(self):
|
||||||
lock = threading.Lock()
|
lock = threading.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user