]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'bug6852'
authorNick Mathewson <nickm@torproject.org>
Tue, 3 Feb 2015 18:06:58 +0000 (13:06 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 3 Feb 2015 18:06:58 +0000 (13:06 -0500)
Conflicts:
src/or/status.c

1  2 
src/or/geoip.c
src/or/geoip.h
src/or/status.c

diff --cc src/or/geoip.c
Simple merge
diff --cc src/or/geoip.h
Simple merge
diff --cc src/or/status.c
index 0717070a056fe42800e0f7f6c75e01f50b0a800d,02d96aa78e8ba2023bd676c3cc3432fd612b9b28..98db688e5b6acf0efb51b4f09e39c49710bbdb97
  #include "router.h"
  #include "circuitlist.h"
  #include "main.h"
 +#include "rephist.h"
 +#include "hibernate.h"
 +#include "rephist.h"
 +#include "statefile.h"
 +
 +static void log_accounting(const time_t now, const or_options_t *options);
+ #include "geoip.h"
  
  /** Return the total number of circuits. */
 -static int
 +STATIC int
  count_circuits(void)
  {
 -  circuit_t *circ;
 -  int nr=0;
 -
 -  for (circ = circuit_get_global_list_(); circ; circ = circ->next)
 -    nr++;
 -
 -  return nr;
 +  return smartlist_len(circuit_get_global_list());
  }
  
  /** Take seconds <b>secs</b> and return a newly allocated human-readable
@@@ -88,13 -86,10 +89,12 @@@ log_heartbeat(time_t now
    char *bw_rcvd = NULL;
    char *uptime = NULL;
    const routerinfo_t *me;
 +  double r = tls_get_write_overhead_ratio();
 +  const int hibernating = we_are_hibernating();
  
    const or_options_t *options = get_options();
-   (void)now;
  
 -  if (public_server_mode(options)) {
 +  if (public_server_mode(options) && !hibernating) {
      /* Let's check if we are in the current cached consensus. */
      if (!(me = router_get_my_routerinfo()))
        return -1; /* Something stinks, we won't even attempt this. */
          100*(U64_TO_DBL(stats_n_data_bytes_packaged) /
               U64_TO_DBL(stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
  
 +  if (r > 1.0) {
 +    double overhead = ( r - 1.0 ) * 100.0;
 +    log_notice(LD_HEARTBEAT, "TLS write overhead: %.f%%", overhead);
 +  }
 +
 +  if (public_server_mode(options))
 +    rep_hist_log_circuit_handshake_stats(now);
 +
 +  circuit_log_ancient_one_hop_circuits(1800);
 +
+   if (options->BridgeRelay) {
+     char *msg = NULL;
+     msg = format_client_stats_heartbeat(now);
+     if (msg)
+       log_notice(LD_HEARTBEAT, "%s", msg);
+     tor_free(msg);
+   }
    tor_free(uptime);
    tor_free(bw_sent);
    tor_free(bw_rcvd);