ソースを参照

Merge branch 'maint-0.2.8'

Nick Mathewson 8 年 前
コミット
3220bd816b
7 ファイル変更28 行追加7 行削除
  1. 5 0
      changes/bug17744_redux
  2. 4 0
      changes/bug18673
  3. 0 2
      configure.ac
  4. 1 1
      doc/tor.1.txt
  5. 14 0
      src/or/circuitlist.c
  6. 2 0
      src/or/circuitlist.h
  7. 2 4
      src/or/control.c

+ 5 - 0
changes/bug17744_redux

@@ -0,0 +1,5 @@
+  o Minor bugfixes (build):
+    - Remove a pair of redundant AM_CONDITIONAL declarations from
+      configure.ac. Fixes one final case of bug 17744; bugfix on
+      0.2.8.2-alpha.
+

+ 4 - 0
changes/bug18673

@@ -0,0 +1,4 @@
+  o Minor bugfixes (memory leak):
+    - Fix a small memory leak that would occur when the
+      TestingEnableCellStatsEvent option was turned on.  Fixes bug 18673;
+      bugfix on 0.2.5.2-alpha.

+ 0 - 2
configure.ac

@@ -58,8 +58,6 @@ fi
 
 
 AM_CONDITIONAL(UNITTESTS_ENABLED, test "x$enable_unittests" != "xno")
 AM_CONDITIONAL(UNITTESTS_ENABLED, test "x$enable_unittests" != "xno")
 AM_CONDITIONAL(COVERAGE_ENABLED, test "x$enable_coverage" = "xyes")
 AM_CONDITIONAL(COVERAGE_ENABLED, test "x$enable_coverage" = "xyes")
-AM_CONDITIONAL(UNITTESTS_ENABLED, test x$enable_unittests != xno)
-AM_CONDITIONAL(COVERAGE_ENABLED, test x$enable_coverage = xyes)
 AM_CONDITIONAL(DISABLE_ASSERTS_IN_UNIT_TESTS, test "x$enable_asserts_in_tests" = "xno")
 AM_CONDITIONAL(DISABLE_ASSERTS_IN_UNIT_TESTS, test "x$enable_asserts_in_tests" = "xno")
 
 
 if test "$enable_static_tor" = "yes"; then
 if test "$enable_static_tor" = "yes"; then

+ 1 - 1
doc/tor.1.txt

@@ -30,7 +30,7 @@ Users bounce their TCP streams -- web traffic, ftp, ssh, etc. -- around the
 network, and recipients, observers, and even the relays themselves have
 network, and recipients, observers, and even the relays themselves have
 difficulty tracking the source of the stream.
 difficulty tracking the source of the stream.
 
 
-By default, **tor** will only act as a client only.  To help the network
+By default, **tor** will act as a client only.  To help the network
 by providing bandwidth as a relay, change the **ORPort** configuration
 by providing bandwidth as a relay, change the **ORPort** configuration
 option -- see below.  Please also consult the documentation on the Tor
 option -- see below.  Please also consult the documentation on the Tor
 Project's website.
 Project's website.

+ 14 - 0
src/or/circuitlist.c

@@ -756,6 +756,18 @@ or_circuit_new(circid_t p_circ_id, channel_t *p_chan)
   return circ;
   return circ;
 }
 }
 
 
+/** Free all storage held in circ->testing_cell_stats */
+void
+circuit_clear_testing_cell_stats(circuit_t *circ)
+{
+  if (!circ)
+    return;
+  SMARTLIST_FOREACH(circ->testing_cell_stats, testing_cell_stats_entry_t *,
+                    ent, tor_free(ent));
+  smartlist_free(circ->testing_cell_stats);
+  circ->testing_cell_stats = NULL;
+}
+
 /** Deallocate space associated with circ.
 /** Deallocate space associated with circ.
  */
  */
 STATIC void
 STATIC void
@@ -767,6 +779,8 @@ circuit_free(circuit_t *circ)
   if (!circ)
   if (!circ)
     return;
     return;
 
 
+  circuit_clear_testing_cell_stats(circ);
+
   if (CIRCUIT_IS_ORIGIN(circ)) {
   if (CIRCUIT_IS_ORIGIN(circ)) {
     origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
     origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
     mem = ocirc;
     mem = ocirc;

+ 2 - 0
src/or/circuitlist.h

@@ -71,6 +71,8 @@ void assert_circuit_ok(const circuit_t *c);
 void circuit_free_all(void);
 void circuit_free_all(void);
 void circuits_handle_oom(size_t current_allocation);
 void circuits_handle_oom(size_t current_allocation);
 
 
+void circuit_clear_testing_cell_stats(circuit_t *circ);
+
 void channel_note_destroy_pending(channel_t *chan, circid_t id);
 void channel_note_destroy_pending(channel_t *chan, circid_t id);
 MOCK_DECL(void, channel_note_destroy_not_pending,
 MOCK_DECL(void, channel_note_destroy_not_pending,
           (channel_t *chan, circid_t id));
           (channel_t *chan, circid_t id));

+ 2 - 4
src/or/control.c

@@ -4971,7 +4971,7 @@ sum_up_cell_stats_by_command(circuit_t *circ, cell_stats_t *cell_stats)
 {
 {
   memset(cell_stats, 0, sizeof(cell_stats_t));
   memset(cell_stats, 0, sizeof(cell_stats_t));
   SMARTLIST_FOREACH_BEGIN(circ->testing_cell_stats,
   SMARTLIST_FOREACH_BEGIN(circ->testing_cell_stats,
-                          testing_cell_stats_entry_t *, ent) {
+                          const testing_cell_stats_entry_t *, ent) {
     tor_assert(ent->command <= CELL_COMMAND_MAX_);
     tor_assert(ent->command <= CELL_COMMAND_MAX_);
     if (!ent->removed && !ent->exitward) {
     if (!ent->removed && !ent->exitward) {
       cell_stats->added_cells_appward[ent->command] += 1;
       cell_stats->added_cells_appward[ent->command] += 1;
@@ -4984,10 +4984,8 @@ sum_up_cell_stats_by_command(circuit_t *circ, cell_stats_t *cell_stats)
       cell_stats->removed_cells_exitward[ent->command] += 1;
       cell_stats->removed_cells_exitward[ent->command] += 1;
       cell_stats->total_time_exitward[ent->command] += ent->waiting_time * 10;
       cell_stats->total_time_exitward[ent->command] += ent->waiting_time * 10;
     }
     }
-    tor_free(ent);
   } SMARTLIST_FOREACH_END(ent);
   } SMARTLIST_FOREACH_END(ent);
-  smartlist_free(circ->testing_cell_stats);
-  circ->testing_cell_stats = NULL;
+  circuit_clear_testing_cell_stats(circ);
 }
 }
 
 
 /** Helper: append a cell statistics string to <code>event_parts</code>,
 /** Helper: append a cell statistics string to <code>event_parts</code>,