[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r15326: Send an initial "Starting" bootstrap status event, so we hav (in tor/trunk: . doc/spec/proposals src/or)



Author: arma
Date: 2008-06-17 04:15:42 -0400 (Tue, 17 Jun 2008)
New Revision: 15326

Modified:
   tor/trunk/ChangeLog
   tor/trunk/doc/spec/proposals/137-bootstrap-phases.txt
   tor/trunk/src/or/main.c
   tor/trunk/src/or/or.h
Log:
Send an initial "Starting" bootstrap status event, so we have a
state to start out in.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-06-17 08:01:43 UTC (rev 15325)
+++ tor/trunk/ChangeLog	2008-06-17 08:15:42 UTC (rev 15326)
@@ -11,6 +11,11 @@
       proposal 138.
     - In directory authorities' approved-routers files, allow
       fingerprints with or without space.
+    - Add a "GETINFO /status/bootstrap-phase" controller option, so the
+      controller can query our current bootstrap state in case it attaches
+      partway through and wants to catch up.
+    - Send an initial "Starting" bootstrap status event, so we have a
+      state to start out in.
 
   o Bugfixes:
     - Asking for a conditional consensus at .../consensus/<fingerprints>

Modified: tor/trunk/doc/spec/proposals/137-bootstrap-phases.txt
===================================================================
--- tor/trunk/doc/spec/proposals/137-bootstrap-phases.txt	2008-06-17 08:01:43 UTC (rev 15325)
+++ tor/trunk/doc/spec/proposals/137-bootstrap-phases.txt	2008-06-17 08:15:42 UTC (rev 15326)
@@ -55,11 +55,10 @@
   the same order. Some phases might also be skipped (not reported) if the
   associated bootstrap step is already complete.
 
-  Phase 0:
+  Phase 1:
   tag=starting summary="starting"
 
-  Tor starts out in this phase. It doesn't actually send a status event
-  to say so.
+  Tor starts out in this phase.
 
   Phase 5:
   tag=conn_dir summary="Connecting to directory mirror"

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2008-06-17 08:01:43 UTC (rev 15325)
+++ tor/trunk/src/or/main.c	2008-06-17 08:15:42 UTC (rev 15326)
@@ -1407,6 +1407,9 @@
   stats_prev_global_read_bucket = global_read_bucket;
   stats_prev_global_write_bucket = global_write_bucket;
 
+  /* initialize the bootstrap status events to know we're starting up */
+  control_event_bootstrap(BOOTSTRAP_STATUS_STARTING, 0);
+
   if (trusted_dirs_reload_certs())
     return -1;
   if (router_reload_v2_networkstatus()) {

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2008-06-17 08:01:43 UTC (rev 15325)
+++ tor/trunk/src/or/or.h	2008-06-17 08:15:42 UTC (rev 15326)
@@ -3054,7 +3054,7 @@
 /** Enum describing various stages of bootstrapping, for use with controller
  * bootstrap status events. The values range from 0 to 100. */
 typedef enum {
-  BOOTSTRAP_STATUS_STARTING=0,
+  BOOTSTRAP_STATUS_STARTING=1,
   BOOTSTRAP_STATUS_CONN_DIR=5,
   BOOTSTRAP_STATUS_HANDSHAKE=-1,
   BOOTSTRAP_STATUS_HANDSHAKE_DIR=10,