aboutsummaryrefslogtreecommitdiff
path: root/src/or/geoip.c
AgeCommit message (Collapse)Author
2010-09-27Fix a bridge segfaultSebastian Hahn
When we enabled support to change statistic options without restarting Tor we forgot to initialize geoip_countries. Fix that.
2010-09-20A start at a patch for bug 1943 (alignment issues)Roger Dingledine
2010-08-16Fix misplaced labelsSebastian Hahn
2010-08-13minor formatting / comment fixesRoger Dingledine
2010-08-05Allow enabling or disabling *Statistics while Tor is running.Karsten Loesing
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.
2010-07-31Set up the geoip country table right even if not called normallyNick Mathewson
2010-07-31Move the "nowhereland" logic into geoip.cNick Mathewson
2010-07-31Make "Nowhere" explicitly listable in torrc.Nick Mathewson
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.
2010-07-27Create control.hSebastian Hahn
2010-07-27Create config.hSebastian Hahn
2010-07-27Create routerlist.hSebastian Hahn
2010-07-27Create geoip.hSebastian Hahn
2010-07-27Split headers for dnsserv.c functions out of or.hSebastian Hahn
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).
2010-07-18Make the controller act more usefully when GETINFO failsNick Mathewson
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.
2010-05-17Make rotate_request_period use BEGIN/END versions of FOREACHNick Mathewson
This appeases some versions of MSVC, which don't like it when you have preprocessor commands inside a set of macro arguments.
2010-04-20Switch geoip_get_request_history to asprintf; fix bug 1365Nick Mathewson
2010-04-02Merge branch 'asprintf'Nick Mathewson
2010-02-28Tweak users of snprintf to use asprintf where appropriateNick Mathewson
2010-02-27Merge remote branch 'origin/maint-0.2.1'Nick Mathewson
Conflicts: src/common/test.h src/or/test.c
2010-02-27Update Tor Project copyright yearsNick Mathewson
2010-01-26Fix a memory corruption bug while collecting bridge statsKarsten Loesing
We accidentally freed the internal buffer for bridge stats when we were writing the bridge stats file or honoring a control port request for said data. Change the interfaces for geoip_get_bridge_stats* to prevent these problems, and remove the offending free/add a tor_strdup. Fixes bug 1208.
2010-01-15don't warn if stats/bridge-stats is missingRoger Dingledine
if we try to read it to publish stats and it's not there, that means there are no stats to publish. reported by swisstorexit.
2010-01-02when loading bridge stats, mkdir $datadir/stats firstRoger Dingledine
2009-12-18Permit an empty "bridge-ips" line when parsing bridge stats.Karsten Loesing
2009-12-17Refactor out the 'find string at start of any line' logic.Nick Mathewson
We do this in too many places throughout the code; it's time to start clamping down. Also, refactor Karsten's patch to use strchr-then-strndup, rather than malloc-then-strlcpy-then-strchr-then-clear.
2009-12-17Make changes to latest bridge-stats fixes as suggested by Nick.Karsten Loesing
2009-12-17Fix bridge statistics.Karsten Loesing
Fix statistics on client numbers by country as seen by bridges that were broken in 0.2.2.1-alpha. Also switch to reporting full 24-hour intervals instead of variable 12-to-48-hour intervals.
2009-12-12Now that FOO_free(NULL) always works, remove checks before calling it.Nick Mathewson
2009-09-24Fix a couple of smaller issues with gathering statistics.Karsten Loesing
- Avoid memmoving 0 bytes which might lead to compiler warnings. - Don't require relays to be entry node AND bridge at the same to time to record clients. - Fix a memory leak when writing dirreq-stats. - Don't say in the stats files that measurement intervals are twice as long as they really are. - Reduce minimum observation time for requests to 12 hours, or we might never record usage. - Clear exit stats correctly after writing them, or we accumulate old stats over time. - Reset interval start for buffer stats, too.
2009-09-01Fix compile warnings on Snow LeopardSebastian Hahn
Big thanks to nickm and arma for helping me with this!
2009-08-26Merge commit 'karsten/proposal-166-impl-master'Nick Mathewson
2009-08-21Add some fixes after discussion with Nick.Karsten Loesing
- Refactor geoip.c by moving duplicate code into rotate_request_period(). - Don't leak memory when cleaning up cell queues. - Make sure that exit_(streams|bytes_(read|written)) are initialized in all places accessing these arrays. - Read only the last block from *stats files and ensure that its timestamp is not more than 25 hours in the past and not more than 1 hour in the future. - Stop truncating the last character when reading *stats files. The only thing that's left now is to avoid reading whole *stats files into memory.
2009-08-21Refactor geoip_get_dirreq_history() some more.Nick Mathewson
This patch avoids a bunch of allocations, and avoids using unallocated memory.
2009-08-21Fix a memory leak in summarizing directory request timing.Nick Mathewson
Spotted by Coverity Scan.
2009-08-19Some final (?) cleanups of proposal 166 implementation.Karsten Loesing
2009-08-19Move all *-stats file to subdirectory stats/.Karsten Loesing
2009-08-19Write all statistics to disk exactly every 24 hours.Karsten Loesing
2009-08-17Include contents of *-stats files in descriptor.Karsten Loesing
2009-08-17Remove ./configure option for entry and dir request statistics.Karsten Loesing
2009-07-27Fix dirreq and cell stats on 32-bit architectures.Karsten Loesing
When determining how long directory requests take or how long cells spend in queues, we were comparing timestamps on microsecond detail only to convert results to second or millisecond detail later on. But on 32-bit architectures this means that 2^31 microseconds only cover time differences of up to 36 minutes. Instead, compare timestamps on millisecond detail.
2009-07-16Switch dirreq_map to use HT_ functions rather than strmap.Nick Mathewson
2009-07-15Some tweaks to statistics.Karsten Loesing
Changes to directory request statistics: - Rename GEOIP statistics to DIRREQ statistics, because they now include more than only GeoIP-based statistics, whereas other statistics are GeoIP-dependent, too. - Rename output file from geoip-stats to dirreq-stats. - Add new config option DirReqStatistics that is required to measure directory request statistics. - Clean up ChangeLog. Also ensure that entry guards statistics have access to a local GeoIP database.
2009-07-15Some tweaks to directory request download times.Karsten Loesing
- Use common prefixes DIRREQ_* and dirreq_*. - Replace enums in structs with bitfields.
2009-07-15Round up results to the next multiple of 4.Karsten Loesing
2009-07-15Right, the u in uint stands for unsigned.Karsten Loesing
2009-07-15Directories now also measure download times of network statuses.Karsten Loesing
2009-07-14make it compile without warningsRoger Dingledine
2009-07-14Merge commit 'karsten/geoipstats-download-resp-master'Nick Mathewson
Conflicts: src/or/geoip.c
2009-07-14Merge commit 'karsten/geoipstats-shares-master'Nick Mathewson
2009-07-14Merge commit 'karsten/geoipstats-newoverthereistan-master'Nick Mathewson