瀏覽代碼

Merge remote-tracking branch 'origin/maint-0.2.4'

Nick Mathewson 12 年之前
父節點
當前提交
eb9b282cc2
共有 5 個文件被更改,包括 19 次插入6 次删除
  1. 4 0
      changes/bug6572
  2. 6 0
      changes/bug8598
  3. 3 0
      src/or/circuitbuild.c
  4. 5 5
      src/or/circuitstats.c
  5. 1 1
      src/or/circuituse.c

+ 4 - 0
changes/bug6572

@@ -0,0 +1,4 @@
+ o Minor bugfixes (log messages)
+   - Use circuit creation time for network liveness evaluation. This
+     should eliminate warning log messages about liveness caused by
+     changes in timeout evaluation. Fixes bug 6572; bugfix on 0.2.4.8-alpha.

+ 6 - 0
changes/bug8598

@@ -0,0 +1,6 @@
+  o Bugfixes:
+    - Fix compilation warning with some versions of clang that would prefer
+      the -Wswitch-enum compiler flag to warn about switch statements with
+      missing enum values, even if those switch statements have a default:
+      statement. Fixes bug 8598; bugfix on 0.2.4.10-alpha.
+

+ 3 - 0
src/or/circuitbuild.c

@@ -2010,6 +2010,9 @@ pathbias_check_close(origin_circuit_t *ocirc, int reason)
       pathbias_count_use_failed(ocirc);
       break;
 
+    case PATH_STATE_NEW_CIRC:
+    case PATH_STATE_BUILD_ATTEMPTED:
+    case PATH_STATE_ALREADY_COUNTED:
     default:
       // Other states are uninteresting. No stats to count.
       break;

+ 5 - 5
src/or/circuitstats.c

@@ -1232,11 +1232,11 @@ circuit_build_times_network_close(circuit_build_times_t *cbt,
       format_local_iso_time(last_live_buf, cbt->liveness.network_last_live);
       format_local_iso_time(start_time_buf, start_time);
       format_local_iso_time(now_buf, now);
-      log_warn(LD_BUG,
-               "Circuit somehow completed a hop while the network was "
-               "not live. Network was last live at %s, but circuit launched "
-               "at %s. It's now %s.", last_live_buf, start_time_buf,
-               now_buf);
+      log_notice(LD_CIRC,
+               "A circuit somehow completed a hop while the network was "
+               "not live. The network was last live at %s, but the circuit "
+               "launched at %s. It's now %s. This could mean your clock "
+               "changed.", last_live_buf, start_time_buf, now_buf);
     }
     cbt->liveness.nonlive_timeouts++;
     if (cbt->liveness.nonlive_timeouts == 1) {

+ 1 - 1
src/or/circuituse.c

@@ -671,7 +671,7 @@ circuit_expire_building(void)
                      circuit_purpose_to_string(victim->purpose));
         } else if (circuit_build_times_count_close(&circ_times,
                                          first_hop_succeeded,
-                                         victim->timestamp_began.tv_sec)) {
+                                         victim->timestamp_created.tv_sec)) {
           circuit_build_times_set_timeout(&circ_times);
         }
       }