Skip to content

Commit

Permalink
Fix crash when trying to see the content of a request/response before…
Browse files Browse the repository at this point in the history
… ack.

self.flow.{response,request}.acked did not exist before acknowledging
the flow.
Also add a message when the response has not been recieved.
  • Loading branch information
Rafiot committed Mar 18, 2013
1 parent 5c33f67 commit f4b1ed0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libmproxy/console/flowview.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ def wrap_body(self, active, body):
else:
parts.append(self._tab(qt, "heading_inactive"))

if self.flow.intercepting and self.flow.response and not self.flow.response.acked:
if self.flow.intercepting and not self.flow.response:
st = "No response yet"
elif self.flow.intercepting and not self.flow.response.acked:
st = "Response intercepted"
else:
st = "Response"
Expand Down
2 changes: 2 additions & 0 deletions libmproxy/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ def __init__(self, client_conn, httpversion, host, port, scheme, method, path, h
self.timestamp_start = timestamp_start or utils.timestamp()
self.timestamp_end = max(timestamp_end or utils.timestamp(), timestamp_start)
self.close = False
self.acked = False

# Have this request's cookies been modified by sticky cookies or auth?
self.stickycookie = False
Expand Down Expand Up @@ -613,6 +614,7 @@ def __init__(self, request, httpversion, code, msg, headers, content, cert, time
self.timestamp_start = timestamp_start or utils.timestamp()
self.timestamp_end = max(timestamp_end or utils.timestamp(), timestamp_start)
self.replay = False
self.acked = False

def _refresh_cookie(self, c, delta):
"""
Expand Down

0 comments on commit f4b1ed0

Please sign in to comment.