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

[tor-commits] [flashproxy/js] Parse facilitator response and call a dummy make_proxy_pair.



commit 2cefb3f850b24d68bf2145e76122b95d5ab77b2e
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Thu Mar 29 19:39:43 2012 -0700

    Parse facilitator response and call a dummy make_proxy_pair.
---
 flashproxy.js |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/flashproxy.js b/flashproxy.js
index 32497e6..d823a3b 100644
--- a/flashproxy.js
+++ b/flashproxy.js
@@ -161,7 +161,36 @@ function FlashProxy()
     };
 
     this.fac_complete = function(text) {
-        this.puts("Facilitator: got response \"" + text + "\".");
+        var response;
+        var client_addr;
+        var relay_addr;
+
+        response = parse_query_string(text);
+
+        if (!response.client) {
+            this.puts("No clients.");
+            return;
+        }
+        client_addr = parse_addr_spec(response.client);
+        if (client_addr === null) {
+            this.puts("Error: can't parse client spec " + repr(response.client) + ".");
+        }
+        if (!response.relay) {
+            this.puts("Error: missing relay in response.");
+            return;
+        }
+        relay_addr = parse_addr_spec(response.relay);
+        if (relay_addr === null) {
+            this.puts("Error: can't parse relay spec " + repr(response.relay) + ".");
+        }
+        puts("Facilitator: got client:" + repr(client_spec) + " "
+            + "relay:" + repr(relay_spec) + ".");
+
+        this.make_proxy_pair(client_addr, relay_addr);
+    };
+
+    this.make_proxy_pair = function(client_addr, relay_addr) {
+        this.puts("make_proxy_pair");
     };
 }
 



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