[or-cvs] Change interface to config_trial_assign even more; have it ...

Nick Mathewson nickm at seul.org
Tue Nov 9 17:15:20 UTC 2004


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

Modified Files:
	config.c control.c or.h 
Log Message:
Change interface to config_trial_assign even more; have it use get_options() instead

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -d -r1.235 -r1.236
--- config.c	9 Nov 2004 10:31:54 -0000	1.235
+++ config.c	9 Nov 2004 17:15:17 -0000	1.236
@@ -674,17 +674,17 @@
   return 0;
 }
 
-/** Try assigning <b>list</b> to <b>options</b>. You do this by duping
+/** Try assigning <b>list</b> to the global options. You do this by duping
  * options, assigning list to the new one, then validating it. If it's
  * ok, then through out the old one and stick with the new one. Else,
  * revert to old and return failure.  Return 0 on success, -1 on bad
  * keys, -2 on bad values, -3 on bad transition.
  */
 int
-config_trial_assign(or_options_t *options, struct config_line_t *list, int reset)
+config_trial_assign(struct config_line_t *list, int reset)
 {
   int r;
-  or_options_t *trial_options = options_dup(options);
+  or_options_t *trial_options = options_dup(get_options());
 
   if ((r=config_assign(trial_options, list, reset)) < 0) {
     options_free(trial_options);
@@ -696,7 +696,7 @@
     return -2;
   }
 
-  if (options_transition_allowed(options, trial_options) < 0) {
+  if (options_transition_allowed(get_options(), trial_options) < 0) {
     options_free(trial_options);
     return -3;
   }

Index: control.c
===================================================================
RCS file: /home/or/cvsroot/src/or/control.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- control.c	9 Nov 2004 10:21:19 -0000	1.21
+++ control.c	9 Nov 2004 17:15:17 -0000	1.22
@@ -209,7 +209,7 @@
     return 0;
   }
 
-  if ((r=config_trial_assign(get_options(), lines, 1)) < 0) {
+  if ((r=config_trial_assign(lines, 1)) < 0) {
     log_fn(LOG_WARN,"Controller gave us config lines that didn't validate.");
     if (r==-1) {
       send_control_error(conn, ERR_UNRECOGNIZED_CONFIG_KEY,

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.470
retrieving revision 1.471
diff -u -d -r1.470 -r1.471
--- or.h	9 Nov 2004 07:55:48 -0000	1.470
+++ or.h	9 Nov 2004 17:15:17 -0000	1.471
@@ -1097,7 +1097,7 @@
 
 int config_get_lines(char *string, struct config_line_t **result);
 void config_free_lines(struct config_line_t *front);
-int config_trial_assign(or_options_t *options, struct config_line_t *list, int reset);
+int config_trial_assign(struct config_line_t *list, int reset);
 int resolve_my_address(const char *address, uint32_t *addr);
 void options_init(or_options_t *options);
 int init_from_config(int argc, char **argv);



More information about the tor-commits mailing list