[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [flashproxy/master] Remove unused get_param_addr.



commit 574125469e29ea95ae1f959b56cfe53bf21cd233
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Wed Dec 21 02:11:12 2016 -0800

    Remove unused get_param_addr.
---
 proxy/flashproxy-test.js | 27 ---------------------------
 proxy/flashproxy.js      | 12 ------------
 2 files changed, 39 deletions(-)

diff --git a/proxy/flashproxy-test.js b/proxy/flashproxy-test.js
index fc4fcd2..5ebc5b1 100755
--- a/proxy/flashproxy-test.js
+++ b/proxy/flashproxy-test.js
@@ -273,32 +273,6 @@ function test_parse_addr_spec() {
     }
 }
 
-function test_get_param_addr() {
-    var DEFAULT = { host: "1.1.1.1", port: 2222 };
-    var TESTS = [
-        { query: { },
-          expected: DEFAULT },
-        { query: { addr: "3.3.3.3:4444" },
-          expected: { host: "3.3.3.3", port: 4444 } },
-        { query: { x: "3.3.3.3:4444" },
-          expected: DEFAULT },
-        { query: { addr: "---" },
-          expected: null },
-    ];
-
-    announce("test_get_param_addr");
-    for (var i = 0; i < TESTS.length; i++) {
-        var test = TESTS[i];
-        var actual;
-
-        actual = get_param_addr(test.query, "addr", DEFAULT);
-        if (objects_equal(actual, test.expected))
-            pass(test.query);
-        else
-            fail(test.query, test.expected, actual);
-    }
-}
-
 function test_lang_keys() {
     var TESTS = [
         { code: "de", expected: ["de"] },
@@ -376,7 +350,6 @@ test_parse_cookie_string();
 test_parse_query_string();
 test_get_param_boolean();
 test_parse_addr_spec();
-test_get_param_addr();
 test_lang_keys();
 test_have_websocket_binary_frames();
 test_is_likely_tor_browser();
diff --git a/proxy/flashproxy.js b/proxy/flashproxy.js
index 632620e..12dd824 100644
--- a/proxy/flashproxy.js
+++ b/proxy/flashproxy.js
@@ -272,18 +272,6 @@ function get_param_string(query, param, default_val) {
         return val;
 }
 
-/* Get an object value and parse it as an address spec. Returns default_val if
-   param is not a key. Returns null on a parsing error. */
-function get_param_addr(query, param, default_val) {
-    var val;
-
-    val = query[param];
-    if (val === undefined)
-        return default_val;
-    else
-        return parse_addr_spec(val);
-}
-
 /* Get an object value and parse it as an integer. Returns default_val if param
    is not a key. Return null on a parsing error. */
 function get_param_integer(query, param, default_val) {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits