[or-cvs] r12370: avoid sending a request for "keys/fp" (for which we'll get a (tor/trunk/src/or)

arma at seul.org arma at seul.org
Sun Nov 4 02:06:09 UTC 2007


Author: arma
Date: 2007-11-03 22:06:09 -0400 (Sat, 03 Nov 2007)
New Revision: 12370

Modified:
   tor/trunk/src/or/routerlist.c
Log:
avoid sending a request for "keys/fp" (for which we'll get a 400 bad
request) if we need more v3 certs but we've already got pending requests
for all of them.


Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-11-04 01:26:00 UTC (rev 12369)
+++ tor/trunk/src/or/routerlist.c	2007-11-04 02:06:09 UTC (rev 12370)
@@ -367,6 +367,12 @@
         fp[HEX_DIGEST_LEN+1] = '\0';
         smartlist_add(fps, fp);
       });
+    if (smartlist_len(fps) == 1) {
+      /* we didn't add any: they were all pending */
+      SMARTLIST_FOREACH(fps, char *, cp, tor_free(cp));
+      smartlist_free(fps);
+      goto done;
+    }
     resource = smartlist_join_strings(fps, "", 0, NULL);
     resource[strlen(resource)-1] = '\0';
     SMARTLIST_FOREACH(fps, char *, cp, tor_free(cp));



More information about the tor-commits mailing list