Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

2 participants

@Rafiot

self.flow.{response,request}.acked did not exist before acknowledging the flow.
Also add a message when the response has not been received.

@Rafiot Rafiot Fix crash when trying to see the content of a request/response before…
… ack.

self.flow.{response,request}.acked did not exist before acknowledging
the flow.
Also add a message when the response has not been recieved.
f4b1ed0
@Rafiot

It might be related to the transparent proxy mode.
This is the command I use: mitmproxy --host -T -vvv --debug

@cortesi cortesi closed this pull request from a commit
@cortesi cortesi Fix crash on intercept.
Fixes #106
800af34
@cortesi cortesi closed this in 800af34
@cortesi
Owner

Thanks for reporting this. The crash was due to some recent refactoring in the IPC mechanism. I've committed a somewhat different fix to the one proposed.

@Rafiot Rafiot deleted the Rafiot:fix_flowview branch
@Rafiot

Excellent, thanks you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 18, 2013
  1. @Rafiot

    Fix crash when trying to see the content of a request/response before…

    Rafiot authored
    … ack.
    
    self.flow.{response,request}.acked did not exist before acknowledging
    the flow.
    Also add a message when the response has not been recieved.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +3 −1 libmproxy/console/flowview.py
  2. +2 −0  libmproxy/flow.py
View
4 libmproxy/console/flowview.py
@@ -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"
View
2  libmproxy/flow.py
@@ -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
@@ -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):
"""
Something went wrong with that request. Please try again.