summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-09 17:15:17 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-09 17:15:17 +0000
commitb9605745566610dddf51be3c1b4018961d0ab3ca (patch)
tree698172909816ae991f6d3bd7a3b4a43ee4d6d806
parenta2079c074f9634a2eeed564d2514b547ab0a0b6b (diff)
downloadtor-b9605745566610dddf51be3c1b4018961d0ab3ca.tar.gz
tor-b9605745566610dddf51be3c1b4018961d0ab3ca.zip
Change interface to config_trial_assign even more; have it use get_options() instead
svn:r2754
-rw-r--r--src/or/config.c8
-rw-r--r--src/or/control.c2
-rw-r--r--src/or/or.h2
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 <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 @@ 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);