[tor-commits] [tor/master] Fixes ticket #2503

nickm at torproject.org nickm at torproject.org
Thu May 12 23:05:46 UTC 2011


commit 42fcf059d2706d43daba2883274d26b8312e2e43
Author: mikey99 <e_zine99 at yahoo.com>
Date:   Thu May 12 17:33:09 2011 -0400

    Fixes ticket #2503
    
    HTTPS error code 403 is now reported as:
    "The https proxy refused to allow connection".
    Used a switch statement for additional error codes to be explained
    in the future.
---
 src/or/connection.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index fc2097f..eaae791 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1504,10 +1504,20 @@ connection_read_https_proxy_response(connection_t *conn)
     return 1;
   }
   /* else, bad news on the status code */
-  log_warn(LD_NET,
-           "The https proxy sent back an unexpected status code %d (%s). "
-           "Closing.",
-           status_code, escaped(reason));
+  switch (status_code) {
+    case 403:
+      log_warn(LD_NET,
+             "The https proxy refused to allow connection to %s "
+             "(status code %d, %s). Closing.",
+             conn->address, status_code, escaped(reason));
+      break;
+    default:
+      log_warn(LD_NET,
+             "The https proxy sent back an unexpected status code %d (%s). "
+             "Closing.",
+             status_code, escaped(reason));
+      break;
+  }
   tor_free(reason);
   return -1;
 }





More information about the tor-commits mailing list