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

[tor-commits] [flashproxy/master] Add fac.put_reg_base64.



commit 669209ac77b4617b5e66d0b6390599a33e0d473b
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Thu Mar 7 00:15:09 2013 -0800

    Add fac.put_reg_base64.
    
    This calls a local facilitator-reg program.
---
 facilitator/fac.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/facilitator/fac.py b/facilitator/fac.py
index 301ba3f..3a84ef4 100644
--- a/facilitator/fac.py
+++ b/facilitator/fac.py
@@ -1,6 +1,7 @@
 import errno
 import re
 import socket
+import subprocess
 
 # A decorator to ignore "broken pipe" errors.
 def catch_epipe(fn):
@@ -261,3 +262,10 @@ def get_reg(facilitator_addr, proxy_addr):
         return response
     else:
         raise ValueError("Facilitator response was not \"OK\"")
+
+def put_reg_base64(b64):
+    """Attempt to add a registration by running a facilitator-reg program
+    locally."""
+    p = subprocess.Popen(["facilitator-reg"], stdin=subprocess.PIPE)
+    stdout, stderr = p.communicate(b64)
+    return p.returncode == 0



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