summaryrefslogtreecommitdiff
path: root/src/or/geoip.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/geoip.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/geoip.c')
-rw-r--r--src/or/geoip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index d369b45aa3..59490bdaf8 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -162,7 +162,7 @@ _geoip_compare_key_to_entry(const void *_key, const void **_member)
/** Return 1 if we should collect geoip stats on bridge users, and
* include them in our extrainfo descriptor. Else return 0. */
int
-should_record_bridge_info(or_options_t *options)
+should_record_bridge_info(const or_options_t *options)
{
return options->BridgeRelay && options->BridgeRecordUsageByCountry;
}
@@ -199,7 +199,7 @@ init_geoip_countries(void)
* with '#' (comments).
*/
int
-geoip_load_file(const char *filename, or_options_t *options)
+geoip_load_file(const char *filename, const or_options_t *options)
{
FILE *f;
const char *msg = "";
@@ -424,7 +424,7 @@ void
geoip_note_client_seen(geoip_client_action_t action,
uint32_t addr, time_t now)
{
- or_options_t *options = get_options();
+ const or_options_t *options = get_options();
clientmap_entry_t lookup, *ent;
if (action == GEOIP_CLIENT_CONNECT) {
/* Only remember statistics as entry guard or as bridge. */