Browse Source

Merge branch 'bug9665_redux'

Nick Mathewson 10 years ago
parent
commit
84df7d73c9
4 changed files with 14 additions and 1 deletions
  1. 4 0
      changes/bug9665
  2. 6 0
      src/or/connection_or.c
  3. 2 1
      src/or/or.h
  4. 2 0
      src/or/reasons.c

+ 4 - 0
changes/bug9665

@@ -0,0 +1,4 @@
+  o Minor features:
+    - Report a failure to connect to a bridge because its transport
+      type has no configured pluggable transport as a new type of bootstrap
+      failure. Resolves ticket 9665. Patch from Fábio J. Bertinatto.

+ 6 - 0
src/or/connection_or.c

@@ -1195,6 +1195,12 @@ connection_or_connect(const tor_addr_t *_addr, uint16_t port,
                "your pluggable transport proxy stopped running.",
                fmt_addrport(&TO_CONN(conn)->addr, TO_CONN(conn)->port),
                transport_name, transport_name);
+
+      control_event_bootstrap_problem(
+                                "Can't connect to bridge",
+                                END_OR_CONN_REASON_PT_MISSING,
+                                conn);
+
     } else {
       log_warn(LD_GENERAL, "Tried to connect to '%s' through a proxy, but "
                "the proxy address could not be found.",

+ 2 - 1
src/or/or.h

@@ -604,7 +604,8 @@ typedef enum {
 #define END_OR_CONN_REASON_NO_ROUTE       6 /* no route to host/net */
 #define END_OR_CONN_REASON_IO_ERROR       7 /* read/write error */
 #define END_OR_CONN_REASON_RESOURCE_LIMIT 8 /* sockets, buffers, etc */
-#define END_OR_CONN_REASON_MISC           9
+#define END_OR_CONN_REASON_PT_MISSING     9 /* PT failed or not available */
+#define END_OR_CONN_REASON_MISC           10
 
 /* Reasons why we (or a remote OR) might close a stream. See tor-spec.txt for
  * documentation of these.  The values must match. */

+ 2 - 0
src/or/reasons.c

@@ -231,6 +231,8 @@ orconn_end_reason_to_control_string(int r)
       return "RESOURCELIMIT";
     case END_OR_CONN_REASON_MISC:
       return "MISC";
+    case END_OR_CONN_REASON_PT_MISSING:
+      return "PT_MISSING";
     case 0:
       return "";
     default: