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

[or-cvs] Add contact field to generated network-status objects



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

Modified Files:
	dirserv.c 
Log Message:
Add contact field to generated network-status objects

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -d -r1.203 -r1.204
--- dirserv.c	1 Sep 2005 08:13:40 -0000	1.203
+++ dirserv.c	2 Sep 2005 20:30:03 -0000	1.204
@@ -1018,6 +1018,7 @@
   uint32_t addr;
   crypto_pk_env_t *private_key = get_identity_key();
   smartlist_t *descriptor_list = get_descriptor_list();
+  const char *contact;
 
   if (!descriptor_list) {
     log_fn(LOG_WARN, "Couldn't get router list.");
@@ -1047,6 +1048,10 @@
     return -1;
   }
 
+  contact = get_options()->ContactInfo;
+  if (!contact)
+    contact = "(none)";
+
   len = 2048+strlen(client_versions)+strlen(server_versions)+identity_pkey_len*2;
   len += (RS_ENTRY_LEN)*smartlist_len(descriptor_list) ;
 
@@ -1054,7 +1059,8 @@
   tor_snprintf(status, len,
                "network-status-version 2\n"
                "dir-source %s %s %d\n"
-               "dir-fingerprint %s\n"
+               "fingerprint %s\n"
+               "contact %s\n"
                "published %s\n"
                "dir-options %s\n"
                "client-versions %s\n"
@@ -1063,6 +1069,7 @@
                hostname, ipaddr, (int)options->DirPort,
                fingerprint,
                published,
+               contact,
                "Names",
                client_versions,
                server_versions,