[or-cvs] Add noisy debug log to hunt for bug in router_update_status...

Nick Mathewson nickm at seul.org
Thu Jul 22 21:20:26 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv2193/src/or

Modified Files:
	routerlist.c 
Log Message:
Add noisy debug log to hunt for bug in router_update_status_from_smartlist 

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- routerlist.c	22 Jul 2004 20:30:02 -0000	1.107
+++ routerlist.c	22 Jul 2004 21:20:23 -0000	1.108
@@ -831,8 +831,27 @@
 {
   int n_names, i, running, approved;
   const char *name;
-  running = approved = 0;
+#if 1
+  char *cp;
+  int n;
+  n = 0;
+  for (i=0; i<smartlist_len(running_list); ++i) {
+    name = smartlist_get(running_list, i);
+    n += strlen(name) + 1;
+  }
+  cp = tor_malloc(n+2);
+  cp[0] = '\0';
+  for (i=0; i<smartlist_len(running_list); ++i) {
+    name = smartlist_get(running_list, i);
+    strlcat(cp, name, n);
+    strlcat(cp, " ", n);
+  }
+  log_fn(LOG_DEBUG, "Updating status of %s from list \"%s\"", 
+         router->nickname, cp);
+  tor_free(cp);
+#endif
 
+  running = approved = 0;
   n_names = smartlist_len(running_list);
   for (i=0; i<n_names; ++i) {
     name = smartlist_get(running_list, i);



More information about the tor-commits mailing list