aboutsummaryrefslogtreecommitdiffstats
path: root/pathod
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-06-05 13:24:46 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-06-05 13:24:46 +1200
commit375d7c9741c1debbc55bf21c864c514d307691ef (patch)
treeb07e75ad73b490bab6d557394245b607574e131a /pathod
parent48da24ae7e7be7af94162d35a463f174e22504f6 (diff)
downloadmitmproxy-375d7c9741c1debbc55bf21c864c514d307691ef.tar.gz
mitmproxy-375d7c9741c1debbc55bf21c864c514d307691ef.tar.bz2
mitmproxy-375d7c9741c1debbc55bf21c864c514d307691ef.zip
Remove last vestiges of noapi and noweb from pathod
Also hide HTTP2 freeze bug by making explain configurable in the tests
Diffstat (limited to 'pathod')
-rw-r--r--pathod/pathod.py24
-rw-r--r--pathod/pathod_cmdline.py8
2 files changed, 9 insertions, 23 deletions
diff --git a/pathod/pathod.py b/pathod/pathod.py
index add33944..ed35a92e 100644
--- a/pathod/pathod.py
+++ b/pathod/pathod.py
@@ -304,9 +304,7 @@ class Pathod(tcp.TCPServer):
staticdir=None,
anchors=(),
sizelimit=None,
- noweb=False,
nocraft=False,
- noapi=False,
nohang=False,
timeout=None,
logreq=False,
@@ -328,7 +326,6 @@ class Pathod(tcp.TCPServer):
None.
sizelimit: Limit size of served data.
nocraft: Disable response crafting.
- noapi: Disable the API.
nohang: Disable pauses.
"""
tcp.TCPServer.__init__(self, addr)
@@ -337,8 +334,8 @@ class Pathod(tcp.TCPServer):
self.staticdir = staticdir
self.craftanchor = craftanchor
self.sizelimit = sizelimit
- self.noweb, self.nocraft = noweb, nocraft
- self.noapi, self.nohang = noapi, nohang
+ self.nocraft = nocraft
+ self.nohang = nohang
self.timeout, self.logreq = timeout, logreq
self.logresp, self.hexdump = logresp, hexdump
self.http2_framedump = http2_framedump
@@ -404,14 +401,13 @@ class Pathod(tcp.TCPServer):
return
def add_log(self, d):
- if not self.noapi:
- with self.loglock:
- d["id"] = self.logid
- self.log.insert(0, d)
- if len(self.log) > self.LOGBUF:
- self.log.pop()
- self.logid += 1
- return d["id"]
+ with self.loglock:
+ d["id"] = self.logid
+ self.log.insert(0, d)
+ if len(self.log) > self.LOGBUF:
+ self.log.pop()
+ self.logid += 1
+ return d["id"]
def clear_log(self):
with self.loglock:
@@ -469,9 +465,7 @@ def main(args): # pragma: no cover
staticdir=args.staticdir,
anchors=args.anchors,
sizelimit=args.sizelimit,
- noweb=args.noweb,
nocraft=args.nocraft,
- noapi=args.noapi,
nohang=args.nohang,
timeout=args.timeout,
logreq=args.logreq,
diff --git a/pathod/pathod_cmdline.py b/pathod/pathod_cmdline.py
index a4f05faf..5ca2ca85 100644
--- a/pathod/pathod_cmdline.py
+++ b/pathod/pathod_cmdline.py
@@ -75,18 +75,10 @@ def args_pathod(argv, stdout_=sys.stdout, stderr_=sys.stderr):
type=str,
help='Size limit of served responses. Understands size suffixes, i.e. 100k.')
parser.add_argument(
- "--noapi", dest='noapi', default=False, action="store_true",
- help='Disable API.'
- )
- parser.add_argument(
"--nohang", dest='nohang', default=False, action="store_true",
help='Disable pauses during crafted response generation.'
)
parser.add_argument(
- "--noweb", dest='noweb', default=False, action="store_true",
- help='Disable both web interface and API.'
- )
- parser.add_argument(
"--nocraft",
dest='nocraft',
default=False,