[or-cvs] Add feature to handle unset (default) configuration options...

Nick Mathewson nickm at seul.org
Sun Jun 19 22:38:38 UTC 2005


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

Modified Files:
	control.c 
Log Message:
Add feature to handle unset (default) configuration options in GETCONF control messages

Index: control.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/control.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- control.c	19 Jun 2005 20:40:41 -0000	1.94
+++ control.c	19 Jun 2005 22:38:36 -0000	1.95
@@ -693,7 +693,12 @@
       }
     } else {
       struct config_line_t *answer = config_get_assigned_option(options,q);
-      /* XXXX handle non-set options in V1 at least*/
+      if (!v0 && !answer) {
+        size_t alen = strlen(q)+8;
+        char *astr = tor_malloc(alen);
+        tor_snprintf(astr, alen, "250-%s\r\n", q);
+        smartlist_add(answers, astr);
+      }
 
       while (answer) {
         struct config_line_t *next;



More information about the tor-commits mailing list