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

[or-cvs] Add notion of "longest nickname-or-hex-digest-with-$"



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

Modified Files:
	dirserv.c routerlist.c or.h 
Log Message:
Add notion of "longest nickname-or-hex-digest-with-$"

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dirserv.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- dirserv.c	22 Jul 2004 06:04:13 -0000	1.66
+++ dirserv.c	22 Jul 2004 21:31:04 -0000	1.67
@@ -699,7 +699,7 @@
   char published[33];
   time_t published_on;
 
-  len = 1024+MAX_NICKNAME_LEN*smartlist_len(descriptor_list);
+  len = 1024+(MAX_HEX_NICKNAME_LEN+2)*smartlist_len(descriptor_list);
   s = tor_malloc_zero(len);
   if (list_running_servers(&cp))
     return -1;

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- routerlist.c	22 Jul 2004 21:20:23 -0000	1.108
+++ routerlist.c	22 Jul 2004 21:31:04 -0000	1.109
@@ -147,7 +147,7 @@
  */
 void add_nickname_list_to_smartlist(smartlist_t *sl, const char *list) {
   const char *start,*end;
-  char nick[MAX_NICKNAME_LEN+1];
+  char nick[MAX_HEX_NICKNAME_LEN+1];
   routerinfo_t *router;
 
   tor_assert(sl);

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.392
retrieving revision 1.393
diff -u -d -r1.392 -r1.393
--- or.h	22 Jul 2004 20:30:02 -0000	1.392
+++ or.h	22 Jul 2004 21:31:04 -0000	1.393
@@ -123,6 +123,8 @@
 
 #define DEFAULT_BANDWIDTH_OP (1024 * 1000)
 #define MAX_NICKNAME_LEN 19
+/* Hex digest plus dollar sign. */
+#define MAX_HEX_NICKNAME_LEN HEX_DIGEST_LEN+1
 #define MAX_DIR_SIZE 500000
 
 #ifdef TOR_PERF