Commit decdf453 authored by Roger Dingledine's avatar Roger Dingledine
Browse files

If we're using bridges and our network goes away, be more willing

to forgive our bridges and try again when we get an application
request. Bugfix on 0.2.0.x.


svn:r18396
parent 8977f24e
Loading
Loading
Loading
Loading
+3 −0
Changes for ChangeLog: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@ Changes in version 0.2.1.12-alpha - 2009-02-??
      probe. Fixes bug 526. Bugfix on 0.1.2.1-alpha.
    - Support changing value of ServerDNSRandomizeCase during SIGHUP.
      Bugfix on 0.2.1.7-alpha.
    - If we're using bridges and our network goes away, be more willing
      to forgive our bridges and try again when we get an application
      request. Bugfix on 0.2.0.x.

  o Minor features:
    - Support platforms where time_t is 64 bits long. (Congratulations,
+1 −1
Changes for doc/TODO.021: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ R d bug: if we launch using bridges, and then stop using bridges, we
    so vidalia can say "recent activity (1-8 users) from sa".
R - investigate: it looks like if the bridge authority is unreachable,
    we're not falling back on querying bridges directly?
R - if "no running bridges known", an application request should make
  o if "no running bridges known", an application request should make
    us retry all our bridges.

For 0.2.1.x:
+12 −1
Changes for src/or/circuitbuild.c: 12 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2260,10 +2260,15 @@ entry_guards_compute_status(void)
 * is established (<b>succeeded</b>==1) or has failed (<b>succeeded</b>==0).
 * If the OR is an entry, change that entry's up/down status.
 * Return 0 normally, or -1 if we want to tear down the new connection.
 *
 * If <b>mark_relay_status</b>, also call router_set_status() on this
 * relay.
 *
 * XXX022 change succeeded and mark_relay_status into 'int flags'.
 */
int
entry_guard_register_connect_status(const char *digest, int succeeded,
                                    time_t now)
                                    int mark_relay_status, time_t now)
{
  int changed = 0;
  int refuse_conn = 0;
@@ -2333,6 +2338,11 @@ entry_guard_register_connect_status(const char *digest, int succeeded,
    }
  }

  /* if the caller asked us to, also update the is_running flags for this
   * relay */
  if (mark_relay_status)
    router_set_status(digest, succeeded);

  if (first_contact) {
    /* We've just added a new long-term entry guard. Perhaps the network just
     * came back? We should give our earlier entries another try too,
@@ -3139,6 +3149,7 @@ bridges_retry_helper(int act)
        }
      }
    });
  log_debug(LD_DIR, "any_known %d, any_running %d", any_known, any_running);
  return any_known && !any_running;
}

+1 −1
Changes for src/or/circuituse.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -812,7 +812,7 @@ circuit_build_failed(origin_circuit_t *circ)
      n_conn->is_bad_for_new_circs = 1;
    }
    if (n_conn_id) {
      entry_guard_register_connect_status(n_conn_id, 0, time(NULL));
      entry_guard_register_connect_status(n_conn_id, 0, 1, time(NULL));
      /* if there are any one-hop streams waiting on this circuit, fail
       * them now so they can retry elsewhere. */
      connection_ap_fail_onehop(n_conn_id, circ->build_state);
+2 −3
Changes for src/or/connection.c: 2 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -572,9 +572,8 @@ connection_about_to_close_connection(connection_t *conn)
        if (connection_or_nonopen_was_started_here(or_conn)) {
          or_options_t *options = get_options();
          rep_hist_note_connect_failed(or_conn->identity_digest, now);
          entry_guard_register_connect_status(or_conn->identity_digest,0,now);
          if (!options->HttpsProxy)
            router_set_status(or_conn->identity_digest, 0);
          entry_guard_register_connect_status(or_conn->identity_digest,0,
                                              !options->HttpsProxy, now);
          if (conn->state >= OR_CONN_STATE_TLS_HANDSHAKING) {
            int reason = tls_error_to_orconn_end_reason(or_conn->tls_error);
            control_event_or_conn_status(or_conn, OR_CONN_EVENT_FAILED,
Loading