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

[tor-commits] [flashproxy/master] Remove FROM parameter in PUT commands.



commit f40667c75b0c0c184760cd0e227b2e575c2bf8b4
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Wed Oct 16 22:08:06 2013 -0700

    Remove FROM parameter in PUT commands.
    
    It was planned to be used for source-based rate limiting, but was
    unused. Adapted from
    "Support new client registrations."
    https://gitweb.torproject.org/user/asn/flashproxy.git/commitdiff/7b3010e1d4338d173bd9aec35e2ed819842d080d
    "http registration: set default remote address properly - put_reg FROM is never actually read by facilitator"
    https://github.com/infinity0/flashproxy/commit/4b8d3d65fbc78eca400e6c33e9987f923a7b18a1
    "report more detailed errors and show stacktraces when unsafe logging"
    https://github.com/infinity0/flashproxy/commit/c1af35b2e2d57cb8850b1cf345d29065766a9410
---
 facilitator/fac.py          |    4 +---
 facilitator/facilitator     |    2 --
 facilitator/facilitator.cgi |    2 +-
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/facilitator/fac.py b/facilitator/fac.py
index 70d482d..5e334a5 100644
--- a/facilitator/fac.py
+++ b/facilitator/fac.py
@@ -239,13 +239,11 @@ def transact(f, command, *params):
         raise ValueError("No newline at end of string returned by facilitator")
     return parse_transaction(line[:-1])
 
-def put_reg(facilitator_addr, client_addr, registrant_addr=None):
+def put_reg(facilitator_addr, client_addr):
     """Send a registration to the facilitator using a one-time socket. Returns
     true iff the command was successful."""
     f = fac_socket(facilitator_addr)
     params = [("CLIENT", format_addr(client_addr))]
-    if registrant_addr is not None:
-        params.append(("FROM", format_addr(registrant_addr)))
     try:
         command, params = transact(f, "PUT", *params)
     finally:
diff --git a/facilitator/facilitator b/facilitator/facilitator
index dfa5660..f7ebf10 100755
--- a/facilitator/facilitator
+++ b/facilitator/facilitator
@@ -248,8 +248,6 @@ class Handler(SocketServer.StreamRequestHandler):
         if client_spec is None:
             return self.error(u"PUT missing CLIENT param")
 
-        # FROM
-
         try:
             reg = Reg.parse(client_spec)
         except ValueError, e:
diff --git a/facilitator/facilitator.cgi b/facilitator/facilitator.cgi
index 3adbc15..f967555 100755
--- a/facilitator/facilitator.cgi
+++ b/facilitator/facilitator.cgi
@@ -89,7 +89,7 @@ def do_post():
         client_addr = fac.parse_addr_spec(client_spec, defhost=remote_addr[0])
     except ValueError:
         exit_error(400)
-    if not fac.put_reg(FACILITATOR_ADDR, client_addr, remote_addr):
+    if not fac.put_reg(FACILITATOR_ADDR, client_addr):
         exit_error(500)
     print """\
 Status: 200\r

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