From b9605745566610dddf51be3c1b4018961d0ab3ca Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 9 Nov 2004 17:15:17 +0000 Subject: Change interface to config_trial_assign even more; have it use get_options() instead svn:r2754 --- src/or/config.c | 8 ++++---- src/or/control.c | 2 +- src/or/or.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/or/config.c b/src/or/config.c index 87d0651a56..847b30987c 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -674,17 +674,17 @@ config_assign(or_options_t *options, struct config_line_t *list, int reset) return 0; } -/** Try assigning list to options. You do this by duping +/** Try assigning list 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 @@ config_trial_assign(or_options_t *options, struct config_line_t *list, int reset 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; } diff --git a/src/or/control.c b/src/or/control.c index 07795044fc..5122a207b1 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -209,7 +209,7 @@ handle_control_setconf(connection_t *conn, uint16_t len, char *body) 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, diff --git a/src/or/or.h b/src/or/or.h index 0f0d7e83a0..221d2b36a7 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1097,7 +1097,7 @@ int options_act(void); 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); -- cgit v1.2.3-54-g00ecf