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

[or-cvs] r10088: Look at the version in the routerinfo as well as the versino (in tor/trunk: . src/or)



Author: nickm
Date: 2007-05-01 16:29:32 -0400 (Tue, 01 May 2007)
New Revision: 10088

Modified:
   tor/trunk/
   tor/trunk/src/or/directory.c
   tor/trunk/src/or/dirserv.c
Log:
 r12622@catbus:  nickm | 2007-05-01 16:29:19 -0400
 Look at the version in the routerinfo as well as the versino in the networkstatus when deciding whether to upload extrainfo



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r12622] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2007-05-01 20:29:26 UTC (rev 10087)
+++ tor/trunk/src/or/directory.c	2007-05-01 20:29:32 UTC (rev 10088)
@@ -110,6 +110,8 @@
       routerstatus_t *rs = &(ds->fake_status.status);
       local_routerstatus_t *lrs = router_get_combined_status_by_digest(
                                                 ds->digest);
+      int new_enough;
+
       size_t upload_len = payload_len;
       if (post_to_hidserv_only && !ds->is_hidserv_authority)
         continue;
@@ -118,8 +120,11 @@
         continue;
       if (purpose == DIR_PURPOSE_UPLOAD_DIR)
         ds->has_accepted_serverdesc = 0;
-      if (extrainfo_len && lrs &&
-          lrs->status.version_supports_extrainfo_upload) {
+
+      new_enough = (lrs && lrs->status.version_supports_extrainfo_upload) ||
+        (router_digest_version_as_new_as(ds->digest,
+                                         "Tor 0.2.0.0-alpha-dev (r10070)"));
+      if (extrainfo_len && new_enough) {
         upload_len += extrainfo_len;
         /* XXXX020 Disable this once it's tested. */
         log_notice(LD_DIR, "I am going to try to upload an extrainfo. How "

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2007-05-01 20:29:26 UTC (rev 10087)
+++ tor/trunk/src/or/dirserv.c	2007-05-01 20:29:32 UTC (rev 10088)
@@ -1750,8 +1750,11 @@
       outp += strlen(outp);
       if (ri->platform && !strcmpstart(ri->platform, "Tor ")) {
         const char *eos = find_whitespace(ri->platform+4);
-        if (eos && !strcmpstart(eos, " (r"))
+        if (eos && !strcmpstart(eos, " (r")) {
+          /* XXXX020 Unify this logic with the other version extraction
+           * logic */
           eos = find_whitespace(eos+1);
+        }
         if (eos) {
           char *platform = tor_strndup(ri->platform, eos-(ri->platform));
           if (tor_snprintf(outp, endp-outp,