]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
lower the number of seconds before we yell about clock jump.
authorRoger Dingledine <arma@torproject.org>
Thu, 15 Jun 2006 09:03:15 +0000 (09:03 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 15 Jun 2006 09:03:15 +0000 (09:03 +0000)
and make the yelling only happen if you're a server.

svn:r6625

src/or/circuitbuild.c
src/or/main.c

index ad2b2f2bf863f2d513008ea65ad1a604869b71f6..919c371073c651ca9f2726fc54b31d4e8d6f9106 100644 (file)
@@ -660,9 +660,13 @@ circuit_send_next_onion_skin(circuit_t *circ)
 void
 circuit_note_clock_jumped(int seconds_elapsed)
 {
-  log(LOG_WARN, LD_GENERAL,
-      "Please report: your clock just jumped %d seconds forward; "
-      "assuming established circuits no longer work.", seconds_elapsed);
+  if (server_mode(get_options()))
+    log(LOG_WARN, LD_GENERAL,
+        "Please report: your clock just jumped %d seconds forward; "
+        "assuming established circuits no longer work.", seconds_elapsed);
+  else
+    log(LOG_NOTICE, LD_GENERAL, "Your clock just jumped %d seconds forward; "
+        "assuming established circuits no longer work.", seconds_elapsed);
   has_completed_circuit=0; /* so it'll log when it works again */
   circuit_mark_all_unused_circs();
   circuit_expire_all_dirty_circs();
index 03173ca044701816487ff5b3305ef0910565e77c..d331c961ccf4ab8170e22a4c72a11b79da6cf439 100644 (file)
@@ -985,9 +985,11 @@ second_elapsed_callback(int fd, short event, void *args)
                me->address, me->dir_port);
   }
 
-  /* if more than 100s have elapsed, probably the clock jumped: doesn't
-   * count. */
-  if (seconds_elapsed < 100)
+/** If more than this many seconds have elapsed, probably the clock
+ * jumped: doesn't count. */
+#define NUM_JUMPED_SECONDS_BEFORE_WARN 10
+/* This used to be 100, but I cranked it down for Mike Chiussi -RD */
+  if (seconds_elapsed < NUM_JUMPED_SECONDS_BEFORE_WARN)
     stats_n_seconds_working += seconds_elapsed;
   else
     circuit_note_clock_jumped(seconds_elapsed);