aboutsummaryrefslogtreecommitdiff
path: root/src/or/geoip.c
Commit message (Collapse)AuthorAge
...
* | Try to use smartlist_add_asprintf consistentlyNick Mathewson2012-01-16
| | | | | | | | | | | | | | (To ensure correctness, in every case, make sure that the temporary variable is deleted, renamed, or lowered in scope, so we can't have any bugs related to accidentally relying on the no-longer-filled variable.)
* | Check for jumping clock in *format_*stats functionsSebastian Hahn2011-10-21
| | | | | | | | | | None of these were real bugs (yet), because the callers made sure everything was fine. Make it more explicit. Suggested by Nick
* | Clean up bridge-stats code.Karsten Loesing2011-08-04
| | | | | | | | | | | | | | | | Only write a bridge-stats string if bridge stats have been initialized. This behavior is similar to dirreq-stats, entry-stats, etc. Also add a few unit tests for the bridge-stats code.
* | Separate generation of an entry-stats string from writing it to disk.Karsten Loesing2011-08-04
| | | | | | | | | | This commit is similar to the previous two commits for dirreq-stats, but for entry-stats.
* | Separate generation of a dirreq-stats string from writing it to disk.Karsten Loesing2011-08-04
| | | | | | | | | | | | | | | | | | | | This patch separates the generation of a dirreq-stats string from actually writing it to disk. The new geoip_format_dirreq_stats() generates a dirreq-stats string that geoip_dirreq_stats_write() writes to disk. All the state changing (e.g., resetting the dirreq-stats history and initializing the next measurement interval) takes place in geoip_dirreq_stats_write(). That allows us to finally test the dirreq-stats code better.
* | Clean up geoip_dirreq_stats_write().Karsten Loesing2011-08-04
| | | | | | | | | | We later want to split this function into one function that generates the dirreq-stats string and one that writes it to disk.
* | Replace files in stats/ rather than appending to them.Karsten Loesing2011-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, we append statistics to files in the stats/ directory for half of the statistics, whereas we overwrite these files for the other half. In particular, we append buffer, dirreq, and entry stats and overwrite exit, connection, and bridge stats. Appending to files was useful when we didn't include stats in extra-info descriptors, because otherwise we'd have to copy them away to prevent Tor from overwriting them. But now that we include statistics in extra-info descriptors, it makes no sense to keep the old statistics forever. We should change the behavior to overwriting instead of appending for all statistics. Implements #2930.
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-07-19
|\|
| * Specify text or binary mode in every start_writing_to_stdio_file callRobert Ransom2011-07-19
| |
* | Replace 4 more sscanf()s with tor_sscanf()Nick Mathewson2011-07-01
| | | | | | | | | | | | | | | | For some inexplicable reason, Coverity departs from its usual standards of avoiding false positives here, and warns about all sscanf usage, even when the formatting strings are totally safe. Addresses CID # 447, 446.
* | Make the get_options() return constNick Mathewson2011-06-14
| | | | | | | | | | | | | | | | 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!
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-06-14
|\|
| * Make ControlSocketsGroupWritable work with User.Jérémy Bobbio2011-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original message from bug3393: check_private_dir() to ensure that ControlSocketsGroupWritable is safe to use. Unfortunately, check_private_dir() only checks against the currently running user… which can be root until privileges are dropped to the user and group configured by the User config option. The attached patch fixes the issue by adding a new effective_user argument to check_private_dir() and updating the callers. It might not be the best way to fix the issue, but it did in my tests. (Code by lunar; changelog by nickm)
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-04-07
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/common/address.c src/common/compat_libevent.c src/common/memarea.c src/common/util.h src/or/buffers.c src/or/circuitbuild.c src/or/circuituse.c src/or/connection.c src/or/directory.c src/or/networkstatus.c src/or/or.h src/or/routerlist.c
| * Merge remote-tracking branch 'public/xxx_fixups' into maint-0.2.2Nick Mathewson2011-04-07
| |\ | | | | | | | | | | | | Conflicts: src/or/or.h
| | * Triage the XXX022 and XXX021 comments remaining in the codeNick Mathewson2011-03-25
| | | | | | | | | | | | | | | Remove some, postpone others, leave some alone. Now the only remaining XXX022s are ones that seem important to fix or investigate.
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-04-07
|\| |
| * | Allow controllers a more up-to-date view of bridge usage.Nick Mathewson2011-04-07
| |/ | | | | | | | | | | | | | | | | | | | | | | Instead of answering GETINFO requests about our geoip usage only after running for 24 hours, this patch makes us answer GETINFO requests immediately. We still round and quantize as before. Implements bug2711. Also, refactor the heck out of the bridge usage formatting code. No longer should we need to do a generate-parse-and-regenerate cycle to get the controller string, and that lets us simplify the code a lot.
* | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-03-18
|\| | | | | | | | | Trivial Conflicts: configure.in
| * Fix signed/unsigned compare warningNick Mathewson2011-03-18
| |
| * Futz with the clang patch a bit and tidy some geoip.c stuffNick Mathewson2011-03-17
| |
| * Fix two compile warnings when using clangSebastian Hahn2011-03-10
| | | | | | | | Issue found by Steven Murdoch
* | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-25
|\| | | | | | | | | Conflicts: src/or/geoip.c
| * Tell which geoip file we're parsingSebastian Hahn2011-01-25
| |
* | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-03
|\|
| * Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-01-03
| |\ | | | | | | | | | | | | | | | Conflicts: src/common/test.h src/or/test.c
| | * Bump copyright statements to 2011Nick Mathewson2011-01-03
| | |
* | | Do cloexec on socketpairs and stdio filesNick Mathewson2010-11-20
| | |
* | | Add two fixes to the new geoip-db-digest line.Karsten Loesing2010-11-12
| | |
* | | Add GeoIP file digest to extra-info descriptor.Karsten Loesing2010-11-09
|/ /
* | Fix a bridge segfaultSebastian Hahn2010-09-27
| | | | | | | | | | When we enabled support to change statistic options without restarting Tor we forgot to initialize geoip_countries. Fix that.
* | A start at a patch for bug 1943 (alignment issues)Roger Dingledine2010-09-20
| |
* | Fix misplaced labelsSebastian Hahn2010-08-16
| |
* | minor formatting / comment fixesRoger Dingledine2010-08-13
| |
* | Allow enabling or disabling *Statistics while Tor is running.Karsten Loesing2010-08-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch we stop scheduling when we should write statistics using a single timestamp in run_scheduled_events(). Instead, we remember when a statistics interval starts separately for each statistic type in geoip.c and rephist.c. Every time run_scheduled_events() tries to write stats to disk, it learns when it should schedule the next such attempt. This patch also enables all statistics to be stopped and restarted at a later time. This patch comes with a few refactorings, some of which were not easily doable without the patch.
* | Set up the geoip country table right even if not called normallyNick Mathewson2010-07-31
| |
* | Move the "nowhereland" logic into geoip.cNick Mathewson2010-07-31
| |
* | Make "Nowhere" explicitly listable in torrc.Nick Mathewson2010-07-31
| | | | | | | | | | | | We already had the country code ?? indicating an unknown country, so all we needed to do to make unknown countries excludable was to make the ?? code discoverable.
* | Create control.hSebastian Hahn2010-07-27
| |
* | Create config.hSebastian Hahn2010-07-27
| |
* | Create routerlist.hSebastian Hahn2010-07-27
| |
* | Create geoip.hSebastian Hahn2010-07-27
| |
* | Split headers for dnsserv.c functions out of or.hSebastian Hahn2010-07-27
| | | | | | | | | | | | | | The next series of commits begins addressing the issue that we're currently including the complete or.h file in all of our source files. To change that, we're splitting function definitions into new header files (one header file per source file).
* | Make the controller act more usefully when GETINFO failsNick Mathewson2010-07-18
| | | | | | | | | | | | | | | | | | | | | | Right now it says "552 internal error" because there's no way for getinfo_helper_*() countries to specify an error message. This patch changes the getinfo_helper_*() interface, and makes most of the getinfo helpers give useful error messages in response to failures. This should prevent recurrences of bug 1699, where a missing GeoIPFile line in the torrc made GETINFO ip-to-county/* fail in a "not obvious how to fix" way.
* | Make rotate_request_period use BEGIN/END versions of FOREACHNick Mathewson2010-05-17
| | | | | | | | | | This appeases some versions of MSVC, which don't like it when you have preprocessor commands inside a set of macro arguments.
* | Switch geoip_get_request_history to asprintf; fix bug 1365Nick Mathewson2010-04-20
| |
* | Merge branch 'asprintf'Nick Mathewson2010-04-02
|\ \
| * | Tweak users of snprintf to use asprintf where appropriateNick Mathewson2010-02-28
| | |
* | | Merge remote branch 'origin/maint-0.2.1'Nick Mathewson2010-02-27
|\ \ \ | |/ / |/| / | |/ | | | | Conflicts: src/common/test.h src/or/test.c
| * Update Tor Project copyright yearsNick Mathewson2010-02-27
| |