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

[or-cvs] Have dirctory authorites note which servers make good V2 di...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv2294/src/or

Modified Files:
	dirserv.c or.h routerparse.c 
Log Message:
Have dirctory authorites note which servers make good V2 directory caches in publishe network-status.

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.277
retrieving revision 1.278
diff -u -d -r1.277 -r1.278
--- dirserv.c	10 Dec 2005 09:36:25 -0000	1.277
+++ dirserv.c	12 Dec 2005 01:03:28 -0000	1.278
@@ -1299,6 +1299,8 @@
                                       ri->cache_info.identity_digest);
       int f_named = naming && ri->is_named;
       int f_valid = ri->is_verified;
+      int f_v2_dir = ri->dir_port &&
+        tor_version_as_new_as(ri->platform,"0.1.1.9-alpha");
       char identity64[BASE64_DIGEST_LEN+1];
       char digest64[BASE64_DIGEST_LEN+1];
       if (options->AuthoritativeDir) {
@@ -1316,7 +1318,7 @@
 
       if (tor_snprintf(outp, endp-outp,
                        "r %s %s %s %s %s %d %d\n"
-                       "s%s%s%s%s%s%s%s\n",
+                       "s%s%s%s%s%s%s%s%s\n",
                        ri->nickname,
                        identity64,
                        digest64,
@@ -1330,7 +1332,8 @@
                        f_named?" Named":"",
                        f_stable?" Stable":"",
                        f_running?" Running":"",
-                       f_valid?" Valid":"")<0) {
+                       f_valid?" Valid":"",
+                       f_v2_dir?" V2Dir":"")<0) {
         warn(LD_BUG, "Unable to print router status.");
         goto done;
       }

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.753
retrieving revision 1.754
diff -u -d -r1.753 -r1.754
--- or.h	8 Dec 2005 21:12:47 -0000	1.753
+++ or.h	12 Dec 2005 01:03:28 -0000	1.754
@@ -827,6 +827,9 @@
   unsigned int is_running:1; /**< True iff this router is up. */
   unsigned int is_named:1; /**< True iff "nickname" belongs to this router. */
   unsigned int is_valid:1; /**< True iff this router is validated. */
+  unsigned int is_v2_dir:1; /**< True iff this router can serve router
+                             * information with v2 of the directory
+                             * protocol */
 } routerstatus_t;
 
 /** DOCDOC */

Index: routerparse.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerparse.c,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -d -r1.162 -r1.163
--- routerparse.c	10 Dec 2005 09:36:26 -0000	1.162
+++ routerparse.c	12 Dec 2005 01:03:28 -0000	1.163
@@ -1057,6 +1057,8 @@
         rs->is_named = 1;
       else if (!strcmp(tok->args[i], "Valid"))
         rs->is_valid = 1;
+      else if (!strcmp(tok->args[i], "V2Dir"))
+        rs->is_v2_dir = 1;
     }
   }