Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when trying to see the content of a request/response before ack. #106

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libmproxy/console/flowview.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ def wrap_body(self, active, body):
else: else:
parts.append(self._tab(qt, "heading_inactive")) 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" st = "Response intercepted"
else: else:
st = "Response" st = "Response"
Expand Down
2 changes: 2 additions & 0 deletions libmproxy/flow.py
Original file line number Original file line 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_start = timestamp_start or utils.timestamp()
self.timestamp_end = max(timestamp_end or utils.timestamp(), timestamp_start) self.timestamp_end = max(timestamp_end or utils.timestamp(), timestamp_start)
self.close = False self.close = False
self.acked = False


# Have this request's cookies been modified by sticky cookies or auth? # Have this request's cookies been modified by sticky cookies or auth?
self.stickycookie = False 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_start = timestamp_start or utils.timestamp()
self.timestamp_end = max(timestamp_end or utils.timestamp(), timestamp_start) self.timestamp_end = max(timestamp_end or utils.timestamp(), timestamp_start)
self.replay = False self.replay = False
self.acked = False


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