aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/pathoc.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-09-27 10:56:06 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-09-27 10:56:06 +1200
commit65108ed4290399be7abbc58662cdc6d4f9371142 (patch)
treeb6dd7c7542327753e91c12946b8a571cef3f9dbc /libpathod/pathoc.py
parent7209a75201a25d7ec2448c6ad1a871c0c403c97e (diff)
downloadmitmproxy-65108ed4290399be7abbc58662cdc6d4f9371142.tar.gz
mitmproxy-65108ed4290399be7abbc58662cdc6d4f9371142.tar.bz2
mitmproxy-65108ed4290399be7abbc58662cdc6d4f9371142.zip
Add pathoc -o, oneshot mode, exits after the first non-ignored response.
Diffstat (limited to 'libpathod/pathoc.py')
-rw-r--r--libpathod/pathoc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py
index 0cc0466d..90f3b98b 100644
--- a/libpathod/pathoc.py
+++ b/libpathod/pathoc.py
@@ -49,6 +49,8 @@ class Pathoc(tcp.TCPClient):
explain: Print request explanation
hexdump: When printing requests or responses, use hex dump output
ignorecodes: Sequence of return codes to ignore
+
+ Returns True if we have a non-ignored response.
"""
try:
r = rparse.parse_request(self.settings, spec)
@@ -94,3 +96,4 @@ class Pathoc(tcp.TCPClient):
else:
if resp:
self._show_summary(fp, *resp)
+ return True