summaryrefslogtreecommitdiff
path: root/src/or/dns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-06-14 13:01:38 -0400
committerNick Mathewson <nickm@torproject.org>2011-06-14 13:17:06 -0400
commit47c8433a0c3c579588e1e5d4f67f16843ba26bca (patch)
treea6424ad37a2337eb1dc24de50e1f3adc75c2c497 /src/or/dns.c
parent22efe2030901e7ef878c8ec358e819bbdb1239f6 (diff)
downloadtor-47c8433a0c3c579588e1e5d4f67f16843ba26bca.tar.gz
tor-47c8433a0c3c579588e1e5d4f67f16843ba26bca.zip
Make the get_options() return const
This lets us make a lot of other stuff const, allows the compiler to generate (slightly) better code, and will make me get slightly fewer patches from folks who stick mutable stuff into or_options_t. const: because not every input is an output!
Diffstat (limited to 'src/or/dns.c')
-rw-r--r--src/or/dns.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index a7fad3d690..5d86e81fa0 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -276,7 +276,7 @@ dns_init(void)
int
dns_reset(void)
{
- or_options_t *options = get_options();
+ const or_options_t *options = get_options();
if (! server_mode(options)) {
if (!the_evdns_base) {
@@ -1026,7 +1026,7 @@ add_answer_to_cache(const char *address, uint8_t is_reverse, uint32_t addr,
static INLINE int
is_test_address(const char *address)
{
- or_options_t *options = get_options();
+ const or_options_t *options = get_options();
return options->ServerDNSTestAddresses &&
smartlist_string_isin_case(options->ServerDNSTestAddresses, address);
}
@@ -1177,7 +1177,7 @@ evdns_err_is_transient(int err)
static int
configure_nameservers(int force)
{
- or_options_t *options;
+ const or_options_t *options;
const char *conf_fname;
struct stat st;
int r;
@@ -1595,7 +1595,7 @@ launch_wildcard_check(int min_len, int max_len, const char *suffix)
static void
launch_test_addresses(int fd, short event, void *args)
{
- or_options_t *options = get_options();
+ const or_options_t *options = get_options();
struct evdns_request *req;
(void)fd;
(void)event;