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

[tor-commits] [flashproxy/master] Catch errors in url_reg.



commit 9094ffce04586a13cef8fdafe7f4005b17285160
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Wed Mar 6 21:42:09 2013 -0800

    Catch errors in url_reg.
    
    Like if facilitator-reg-url is not running.
---
 facilitator/facilitator.cgi |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/facilitator/facilitator.cgi b/facilitator/facilitator.cgi
index 003cf86..0324fe5 100755
--- a/facilitator/facilitator.cgi
+++ b/facilitator/facilitator.cgi
@@ -47,9 +47,13 @@ def do_get():
     path_parts = [x for x in path_info.split("/") if x]
     if len(path_parts) == 2 and path_parts[0] == "reg":
         # This is a URL-based registration.
-        if not url_reg(path_parts[1]):
+        try:
+            if url_reg(path_parts[1]):
+                output_status(204)
+            else:
+                exit_error(400)
+        except:
             exit_error(500)
-        output_status(204)
     elif len(path_parts) == 0:
         try:
             reg = fac.get_reg(FACILITATOR_ADDR, remote_addr) or ""



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