Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,10 @@ def mptcp_status_page(): | |
port = request.environ.get('REMOTE_PORT') | ||
|
||
try: | ||
conn_without_header = check_output(["ss", "-MtnH", "src", f"{addr}", "sport", f"{port}"]).decode("ascii") | ||
conn_without_header = "\n".join(conn_without_header.split("\n")[1:]) | ||
if (conn_without_header == ""): | ||
conn = check_output(["ss", "-MnH", "dst", f"{addr}", "dport", f"{port}"]).decode("ascii") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
CrapsDorian
Author
Collaborator
|
||
if (conn == ""): | ||
This comment has been minimized.
Sorry, something went wrong. |
||
pass | ||
|
||
filtered_list = list(filter(None, conn_without_header.split(' '))) | ||
if filtered_list and filtered_list[0] == "mptcp": | ||
if conn.startswith("ESTAB"): | ||
state_message = 'Established' | ||
state_class = 'success' | ||
else: | ||
This comment has been minimized.
Sorry, something went wrong.
matttbe
|
||
|
@@ -50,5 +47,4 @@ def generate_audio(): | |
break | ||
yield audio_chunk | ||
|
||
return Response(generate_audio(), mimetype='audio/mpeg') | ||
|
||
return Response(generate_audio(), mimetype='audio/mpeg') |
easier to read with: