Commit 86907ea4 authored by Roger Dingledine's avatar Roger Dingledine
Browse files

Merge branch 'maint-0.2.4'

parents 6156887a 2c877d2d
Loading
Loading
Loading
Loading

changes/ticket9658

0 → 100644
+4 −0
Original line number Diff line number Diff line
  o Minor features:
    - Track how many "TAP" and "NTor" circuit handshake requests we get,
      and how many we complete, and log it every hour to help relay
      operators follow trends in network load. Addresses ticket 9658.
+3 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include "hibernate.h"
#include "nodelist.h"
#include "onion.h"
#include "rephist.h"
#include "relay.h"
#include "router.h"
#include "routerlist.h"
@@ -277,6 +278,8 @@ command_process_create_cell(cell_t *cell, channel_t *chan)

  if (create_cell->handshake_type != ONION_HANDSHAKE_TYPE_FAST) {
    /* hand it off to the cpuworkers, and then return. */
    if (connection_or_digest_is_known_relay(chan->identity_digest))
      rep_hist_note_circuit_handshake_requested(create_cell->handshake_type);
    if (assign_onionskin_to_cpuworker(NULL, circ, create_cell) < 0) {
      log_debug(LD_GENERAL,"Failed to hand off onionskin. Closing.");
      circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_RESOURCELIMIT);
+5 −0
Original line number Diff line number Diff line
@@ -19,9 +19,11 @@
#include "circuitlist.h"
#include "config.h"
#include "connection.h"
#include "connection_or.h"
#include "cpuworker.h"
#include "main.h"
#include "onion.h"
#include "rephist.h"
#include "router.h"

/** The maximum number of cpuworker processes we will keep around. */
@@ -683,6 +685,9 @@ assign_onionskin_to_cpuworker(connection_t *cpuworker,
      return -1;
    }

    if (connection_or_digest_is_known_relay(circ->p_chan->identity_digest))
      rep_hist_note_circuit_handshake_completed(onionskin->handshake_type);

    should_time = should_time_request(onionskin->handshake_type);
    memset(&req, 0, sizeof(req));
    req.magic = CPUWORKER_REQUEST_MAGIC;
+5 −0
Original line number Diff line number Diff line
@@ -1369,6 +1369,11 @@ run_scheduled_events(time_t now)
        next_time_to_write_stats_files = next_write;
    }
    time_to_write_stats_files = next_time_to_write_stats_files;

    /* Also commandeer this opportunity to log how our circuit handshake
     * stats have been doing. */
    if (public_server_mode(options))
      rep_hist_log_circuit_handshake_stats(now);
  }

  /* 1h. Check whether we should write bridge statistics to disk.
+2 −1
Original line number Diff line number Diff line
@@ -226,7 +226,8 @@ decide_next_handshake_type(void)
     * got here first. In any case this edge case will only become relevant
     * once tap is rare. We should reevaluate whether we like this decision
     * once tap gets more rare. */
    if (ol_entries[ONION_HANDSHAKE_TYPE_NTOR])
    if (ol_entries[ONION_HANDSHAKE_TYPE_NTOR] &&
        recently_chosen_ntors <= num_ntors_per_tap())
      ++recently_chosen_ntors;

    return ONION_HANDSHAKE_TYPE_NTOR; /* no taps? try ntor */
Loading