minor refactor

This commit is contained in:
Marcelo Glezer 2015-03-03 00:55:23 -03:00
parent f514eacd7a
commit 8a672b7955

View File

@ -48,8 +48,8 @@ class FlowDetailsView(urwid.ListBox):
timing_parts.append(["Server conn. TCP handshake", utils.format_timestamp_with_milli(sc.timestamp_tcp_setup) if sc.timestamp_tcp_setup else "active"]) timing_parts.append(["Server conn. TCP handshake", utils.format_timestamp_with_milli(sc.timestamp_tcp_setup) if sc.timestamp_tcp_setup else "active"])
if sc.ssl_established: if sc.ssl_established:
timing_parts.append(["Server conn. SSL handshake", utils.format_timestamp_with_milli(sc.timestamp_ssl_setup) if sc.timestamp_ssl_setup else "active"]) timing_parts.append(["Server conn. SSL handshake", utils.format_timestamp_with_milli(sc.timestamp_ssl_setup) if sc.timestamp_ssl_setup else "active"])
if cc:
if sc.ssl_established: if cc and sc.ssl_established:
timing_parts.append(["Client conn. SSL handshake", utils.format_timestamp_with_milli(cc.timestamp_ssl_setup) if cc.timestamp_ssl_setup else "active"]) timing_parts.append(["Client conn. SSL handshake", utils.format_timestamp_with_milli(cc.timestamp_ssl_setup) if cc.timestamp_ssl_setup else "active"])
timing_parts.append(["First request byte", utils.format_timestamp_with_milli(req.timestamp_start)]) timing_parts.append(["First request byte", utils.format_timestamp_with_milli(req.timestamp_start)])
@ -59,7 +59,6 @@ class FlowDetailsView(urwid.ListBox):
timing_parts.append(["First response byte", utils.format_timestamp_with_milli(resp.timestamp_start)]) timing_parts.append(["First response byte", utils.format_timestamp_with_milli(resp.timestamp_start)])
timing_parts.append(["response complete", utils.format_timestamp_with_milli(resp.timestamp_end) if resp.timestamp_end else "active"]) timing_parts.append(["response complete", utils.format_timestamp_with_milli(resp.timestamp_end) if resp.timestamp_end else "active"])
if sc: if sc:
text.append(urwid.Text([("head", "Server Connection:")])) text.append(urwid.Text([("head", "Server Connection:")]))
parts = [ parts = [
@ -68,7 +67,7 @@ class FlowDetailsView(urwid.ListBox):
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4)) text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
c = self.flow.server_conn.cert c = sc.cert
if c: if c:
text.append(urwid.Text([("head", "Server Certificate:")])) text.append(urwid.Text([("head", "Server Certificate:")]))
parts = [ parts = [