[tbb-commits] [torbutton/master] Bug 26555: Don't show IP address for meek or snowflake
gk at torproject.org
gk at torproject.org
Mon Sep 17 19:51:24 UTC 2018
commit 51c3b458ef0d9bf4a0df42410a4d02e6c49c97d4
Author: Arthur Edelstein <arthuredelstein at gmail.com>
Date: Mon Sep 17 09:53:40 2018 -0700
Bug 26555: Don't show IP address for meek or snowflake
(the IP address for these PTs looks like 0.x.x.x)
Also, we remove some dead code that implemented
part of the old circuit display.
---
src/chrome/content/tor-circuit-display.js | 34 ++-----------------------------
1 file changed, 2 insertions(+), 32 deletions(-)
diff --git a/src/chrome/content/tor-circuit-display.js b/src/chrome/content/tor-circuit-display.js
index bbabe1c8..6105fea1 100644
--- a/src/chrome/content/tor-circuit-display.js
+++ b/src/chrome/content/tor-circuit-display.js
@@ -229,36 +229,6 @@ let showCircuitDisplay = function (show) {
'block' : 'none';
};
-// __nodeLines(nodeData)__.
-// Takes a nodeData array of node items, each like
-// `{ ip : "12.34.56.78", country : "fr" }`
-// and converts each node data to text, as
-// `"France (12.34.56.78)"`.
-let nodeLines = function (nodeData) {
- let result = [];
- for (let {ip, countryCode, type, bridgeType} of nodeData) {
- let bridge = type === "bridge",
- country = countryCode ? localizedCountryNameFromCode(countryCode) : null;
- result.push(
- bridge ?
- // As we have a bridge, don't show the IP address
- // but show the bridge type.
- (uiString("tor_bridge") +
- ((bridgeType !== "vanilla") ? (": " + bridgeType) : "") +
- (country ? " (" + country + ")" : ""))
- :
- // For each non-bridge relay, show its host country and IP.
- country +
- // As we don't have a bridge, show the IP address
- // of the node. Use unicode escapes to ensure that
- // parentheses behave properly in both left-to-right
- // and right-to-left languages.
- " ‭ (" + (ip || uiString("ip_unknown")) + ")‬"
- );
- }
- return result;
-};
-
// __xmlTree(ns, data)__.
// Takes an xml namespace, ns, and a
// data structure representing xml elements like
@@ -324,8 +294,8 @@ let updateCircuitDisplay = function () {
} else {
relayText = localizedCountryNameFromCode(nodeData[i].countryCode);
}
- li(relayText, " ",
- ["span", { class: "circuit-ip-address" }, nodeData[i].ip], " ",
+ let ip = nodeData[i].ip.startsWith("0.") ? "" : nodeData[i].ip;
+ li(relayText, " ", ["span", { class: "circuit-ip-address" }, ip], " ",
(i === 0 && nodeData[0].type !== "bridge") ?
["span", { class: "circuit-guard-info" }, uiString("guard")] : null);
}
More information about the tbb-commits
mailing list