summaryrefslogtreecommitdiff
path: root/src/or/geoip.c
AgeCommit message (Collapse)Author
2016-02-27Update the copyright year.Nick Mathewson
2015-12-18Fix a null-pointer deref when writing geoip statsNick Mathewson
Found by coverity; CID 1327892.
2015-12-15Replace usage of INLINE with inlinecypherpunks
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]
2015-11-23fix two typos in commentsRoger Dingledine
2015-09-15Add tests for directory_handle_command_getReinaldo de Souza Jr
2015-02-03Merge branch 'bug6852'Nick Mathewson
Conflicts: src/or/status.c
2015-02-03Choose a more deliberate cutoff for clients in heartbeatNick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-02Apply new calloc coccinelle patchNick Mathewson
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-02Another clang analyzer complaint wrt HT_GENERATENick Mathewson
We're calling mallocfn() and reallocfn() in the HT_GENERATE macro with the result of a product. But that makes any sane analyzer worry about overflow. This patch keeps HT_GENERATE having its old semantics, since we aren't the only project using ht.h. Instead, define a HT_GENERATE2 that takes a reallocarrayfn.
2014-08-29Introduce full coverage tests for module routerset.c.dana koch
This is using the paradigm introduced for test_status.c.
2014-08-13Apply coccinelle script to replace malloc(a*b)->calloc(a,b)Nick Mathewson
2014-03-25Fix warnings from doxygenNick Mathewson
Most of these are simple. The only nontrivial part is that our pattern for using ENUM_BF was confusing doxygen by making declarations that didn't look like declarations.
2014-02-28Merge remote-tracking branch 'karsten/task-5824'Nick Mathewson
2014-02-12Siphash-2-4 is now our hash in nearly all cases.Nick Mathewson
I've made an exception for cases where I'm sure that users can't influence the inputs. This is likely to cause a slowdown somewhere, but it's safer to siphash everything and *then* look for cases to optimize. This patch doesn't actually get us any _benefit_ from siphash yet, since we don't really randomize the key at any point.
2013-12-18Report complete directory request statistics on bridges.Karsten Loesing
When we wrote the directory request statistics code in August 2009, we thought that these statistics were only relevant for bridges, and that bridges should not report them. That's why we added a switch to discard relevant observations made by bridges. This code was first released in 0.2.2.1-alpha. In May 2012 we learned that we didn't fully disable directory request statistics on bridges. Bridges did report directory request statistics, but these statistics contained empty dirreq-v3-ips and dirreq-v3-reqs lines. But the remaining dirreq-* lines have always been non-empty. (We didn't notice for almost three years, because directory-request statistics were disabled by default until 0.2.3.1-alpha, and all statistics have been removed from bridge descriptors before publishing them on the metrics website.) Proposal 201, created in May 2012, suggests to add a new line called bridge-v3-reqs that is similar to dirreq-v3-reqs, but that is published only by bridges. This proposal is still open as of December 2013. Since October 2012 we're using dirreq-v3-resp (not -reqs) lines in combination with bridge-ips lines to estimate bridge user numbers; see task 8462. This estimation method has superseded the older approach that was only based on bridge-ips lines in November 2013. Using dirreq-v3-resp and bridge-ips lines is a workaround. The cleaner approach would be to use dirreq-v3-reqs instead. This commit makes bridges report the same directory request statistics as relays, including dirreq-v3-ips and dirreq-v3-reqs lines. It makes proposal 201 obsolete.
2013-08-15Add a clientmap_entry_free().Nick Mathewson
Remove a nedless strdup/free pair.
2013-08-15Fix hash functions for transport_name in client entryNick Mathewson
2013-08-15Use only uintptr_t for the value of transport_countNick Mathewson
2013-08-15If a single client connects with multiple transports, note all transports.George Kadianakis
2013-08-15Fix a number of issues with the #5040 code.George Kadianakis
- Don't leak if a transport proxy sends us a TRANSPORT command more than once. - Don't use smartlist_string_isin() in geoip_get_transport_history(). (pointed out by Nick) - Use the 'join' argument of smartlist_join_strings() instead of trying to write the separator on our own. (pointed out by Nick) - Document 'ext_or_transport' a bit better. (pointed out by Nick) - Be a bit more consistent with the types of the values of 'transport_counts'. (pointed out by Nick)
2013-08-15Make check-spaces happy.George Kadianakis
2013-07-18Write extra-info bridge-ip-transports lines.George Kadianakis
2013-07-18Add transport information to the GeoIP database.George Kadianakis
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-05-24Reformat 4282 fixes a littleNick Mathewson
2013-05-24Fix a logic error in 4282 fixesNick Mathewson
check_or_create_data_subdir has succeeded when it returns 0, not when it returns negative.
2013-05-24Extract duplicate code in geoip and rephist.Peter Retzlaff
Create new methods check_or_create_data_subdir() and write_to_data_subdir() in config.c and use them throughout rephist.c and geoip.c. This should solve ticket #4282.
2013-02-26Add unique client counter to the heartbeat message.George Kadianakis
2013-02-07Merge remote-tracking branch 'public/bug7816_023'Nick Mathewson
Conflicts: src/common/util.c
2013-01-17Remove dirreq-v2-* lines from extra-info descriptors.Karsten Loesing
Implements the rest of #5823.
2013-01-16Removee dirrec-v*-sharestatisticsNick Mathewson
These were unused and sometimes inaccurate. Resolves 5823.
2013-01-16Update the copyright date to 201.Nick Mathewson
2012-12-28Fix various small leaks on error casesNick Mathewson
Spotted by coverity, bug 7816, bugfix on various versions.
2012-12-13Nuke uses of memcmp outside of unit testsNick Mathewson
We want to be saying fast_mem{cmp,eq,neq} when we're doing a comparison that's allowed to exit early, or tor_mem{cmp,eq,neq} when we need a data-invariant timing. Direct use of memcmp tends to imply that we haven't thought about the issue.
2012-11-04Whitespace fixesNick Mathewson
2012-11-04Merge remote-tracking branch 'linus/bug5053-bug5055'Nick Mathewson
Conflicts: src/or/geoip.c
2012-10-31Change some comments to reflect the multitude of GeoIP databases.Linus Nordberg
2012-10-31Don't memcmp struct in6_addr but rather its s6_addr member.Linus Nordberg
2012-10-31Duplicate less code.Linus Nordberg
2012-10-22Name variables more consistently.Linus Nordberg
2012-10-20Rename C reserved identifiers missed before.Linus Nordberg
2012-10-20Add "IPVersions" to control command "status/clients-seen".Linus Nordberg
2012-10-20Duplicate less code.Linus Nordberg
2012-10-20Separate IPv4 and IPv6 geoip file loading.Linus Nordberg
Also add IPv6 geoip file digest to extra info. Also also, add support for IPv6 addresses in control command "ip-to-country".
2012-10-17White space.Linus Nordberg
2012-10-17Rename reserved C identifiers.Linus Nordberg
2012-10-17Minor tweaks to nils' v4 vs v6 bridge usage code.Karsten Loesing
2012-10-17Minor tweaks and comments to nils' geoip v6 code.Karsten Loesing