[tor-commits] [tor/master] Merge branch 'bug6852'

nickm at torproject.org nickm at torproject.org
Tue Feb 3 18:07:08 UTC 2015


commit cdc49629c7d26e9806b8aa3c5a7dc80fbec9d060
Merge: d03e1da 7f52dc4
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Feb 3 13:06:58 2015 -0500

    Merge branch 'bug6852'
    
    Conflicts:
    	src/or/status.c

 changes/bug6852 |    3 +++
 src/or/geoip.c  |   33 +++++++++++++++++++++++++++++++++
 src/or/geoip.h  |    1 +
 src/or/status.c |   10 +++++++++-
 4 files changed, 46 insertions(+), 1 deletion(-)

diff --cc src/or/status.c
index 0717070,02d96aa..98db688
--- a/src/or/status.c
+++ b/src/or/status.c
@@@ -17,18 -14,19 +17,19 @@@
  #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. */
@@@ -122,16 -112,14 +122,24 @@@
          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);



More information about the tor-commits mailing list